SHARE
TWEET

Untitled

a guest Aug 20th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
  2.     {
  3.         {
  4.             string empId = context.RouteData.Values[RouteValues.EmployerAccountId]?.ToString().ToUpper();
  5.  
  6.             const string StrictCookieKey = "strictCookie";
  7.             const string LaxCookieKey = "laxCookie";
  8.  
  9.             string strictCookie = context.HttpContext.Request.Cookies[StrictCookieKey]?.ToString();
  10.             string laxCookie = context.HttpContext.Request.Cookies[LaxCookieKey]?.ToString();
  11.  
  12.             context.HttpContext.Response.Cookies.Append(StrictCookieKey, "XXX", new CookieOptions
  13.             {
  14.                 Secure = false,
  15.                 SameSite = SameSiteMode.Strict,
  16.                 HttpOnly = true
  17.             });
  18.  
  19.             context.HttpContext.Response.Cookies.Append(LaxCookieKey, "XXX", new CookieOptions
  20.             {
  21.                 Secure = false,
  22.                 SameSite = SameSiteMode.Lax,
  23.                 HttpOnly = true
  24.             });
  25.  
  26.             context.Result = new RedirectResult(context.HttpContext.Request.Path);
  27.             return;
  28.         }
  29.         // Some unreachable code here
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top