CookiePolicyOptionsExtensions.HandleSameSiteCookieCompatibility Method

Definition

Overloads

HandleSameSiteCookieCompatibility(CookiePolicyOptions)

Handles SameSite cookie issue according to the https://docs.microsoft.com/en-us/aspnet/core/security/samesite?view=aspnetcore-3.1. The default list of user agents that disallow "SameSite=None", was taken from https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/.

HandleSameSiteCookieCompatibility(CookiePolicyOptions, Func<String,Boolean>)

Handles SameSite cookie issue according to the docs: https://docs.microsoft.com/en-us/aspnet/core/security/samesite?view=aspnetcore-3.1 The default list of user agents that disallow "SameSite=None", was taken from https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/.

HandleSameSiteCookieCompatibility(CookiePolicyOptions)

Handles SameSite cookie issue according to the https://docs.microsoft.com/en-us/aspnet/core/security/samesite?view=aspnetcore-3.1. The default list of user agents that disallow "SameSite=None", was taken from https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/.

public static Microsoft.AspNetCore.Builder.CookiePolicyOptions HandleSameSiteCookieCompatibility (this Microsoft.AspNetCore.Builder.CookiePolicyOptions options);
static member HandleSameSiteCookieCompatibility : Microsoft.AspNetCore.Builder.CookiePolicyOptions -> Microsoft.AspNetCore.Builder.CookiePolicyOptions
<Extension()>
Public Function HandleSameSiteCookieCompatibility (options As CookiePolicyOptions) As CookiePolicyOptions

Parameters

options
Microsoft.AspNetCore.Builder.CookiePolicyOptions

Microsoft.AspNetCore.Builder.CookiePolicyOptionsto update.

Returns

Microsoft.AspNetCore.Builder.CookiePolicyOptions

Microsoft.AspNetCore.Builder.CookiePolicyOptions to chain.

Applies to

HandleSameSiteCookieCompatibility(CookiePolicyOptions, Func<String,Boolean>)

Handles SameSite cookie issue according to the docs: https://docs.microsoft.com/en-us/aspnet/core/security/samesite?view=aspnetcore-3.1 The default list of user agents that disallow "SameSite=None", was taken from https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/.

public static Microsoft.AspNetCore.Builder.CookiePolicyOptions HandleSameSiteCookieCompatibility (this Microsoft.AspNetCore.Builder.CookiePolicyOptions options, Func<string,bool> disallowsSameSiteNone);
static member HandleSameSiteCookieCompatibility : Microsoft.AspNetCore.Builder.CookiePolicyOptions * Func<string, bool> -> Microsoft.AspNetCore.Builder.CookiePolicyOptions
<Extension()>
Public Function HandleSameSiteCookieCompatibility (options As CookiePolicyOptions, disallowsSameSiteNone As Func(Of String, Boolean)) As CookiePolicyOptions

Parameters

options
Microsoft.AspNetCore.Builder.CookiePolicyOptions

Microsoft.AspNetCore.Builder.CookiePolicyOptionsto update.

disallowsSameSiteNone
System.Func<System.String,System.Boolean>

If you don't want to use the default user agent list implementation, the method sent in this parameter will be run against the user agent and if returned true, SameSite value will be set to Unspecified. The default user agent list used can be found at: https://devblogs.microsoft.com/aspnet/upcoming-samesite-cookie-changes-in-asp-net-and-asp-net-core/.

Returns

Microsoft.AspNetCore.Builder.CookiePolicyOptions

Microsoft.AspNetCore.Builder.CookiePolicyOptions to chain.

Applies to