Class HttpCookieSameSiteExtensions

Extension methods to support working with SameSiteType on System.Web.HttpCookie

Inheritance
System.Object
HttpCookieSameSiteExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Framework.Web
Assembly: EPiServer.Framework.AspNet.dll
Version: 11.20.7
Syntax
public static class HttpCookieSameSiteExtensions

Methods

GetSameSiteType(HttpCookie)

Get "SameSite" property if it exists (.NET 4.7.2+) or fallback to get policy from "Path" property

Declaration
public static SameSiteType? GetSameSiteType(this HttpCookie cookie)
Parameters
Type Name Description
System.Web.HttpCookie cookie
Returns
Type Description
System.Nullable<SameSiteType>

SetSameSiteType(HttpCookie, SameSiteType)

Assign "SameSite" property if it exists (.NET 4.7.2+) or fallback to append policy to "Path" property

Declaration
public static void SetSameSiteType(this HttpCookie cookie, SameSiteType value)
Parameters
Type Name Description
System.Web.HttpCookie cookie
SameSiteType value