-
Notifications
You must be signed in to change notification settings - Fork 260
Description
The ability to set the SameSite cookie attribute would be useful, especially with currently ongoing changes to browsers' handling of cookies without a SameSite policy set.
Modern browsers are currently rolling out changes setting the default for cookies to SameSite=Lax, which prevents cookies from being included in Cross-Origin requests. Without support for setting the SameSite attribute to None, it will be impossible to use cookies in CORS requests, which is especially problematic for Cross-Origin APIs that rely on storing data in the Plumber session cookie.
The proposed changes include adding a new optional parameter called sameSite to the sessionCookie() function and the Response class's setCookie() and removeCookie() methods. If this parameter is set to a character value, the attribute SameSite=<value> will be added to the generated cookie.