private void CheckSameSite(HttpContext httpContext, CookieOptions options)
 {
     if (options.SameSite == SameSiteMode.None)
     {
         var userAgent = httpContext.Request.Headers["User-Agent"].ToString();
         if (MyUserAgentDetectionLib.DisallowsSameSiteNone(userAgent))
         {
             options.SameSite = (SameSiteMode)(-1);
         }
     }
 }
示例#2
0
文件: Startup31.cs 项目: Zeroshi/Docs
 private void CheckSameSite(HttpContext httpContext, CookieOptions options)
 {
     if (options.SameSite == SameSiteMode.None)
     {
         var userAgent = httpContext.Request.Headers["User-Agent"].ToString();
         #region snippet2
         if (MyUserAgentDetectionLib.DisallowsSameSiteNone(userAgent))
         {
             options.SameSite = SameSiteMode.Unspecified;
         }
         #endregion
     }
 }