Questions tagged [samesite]

Use this tag for questions about errors caused by a browser ignoring a Set-Cookie header—especially for cross-origin requests—due to a SameSite attribute being missing or having a certain value. Also for questions about implementing SameSite in your site's response headers. Consider adding the [cookies] tag too. SameSite instructs browsers to either restrict a cookie to first-party / same-site contexts or allow it in third-party / cross-site contexts.

The SameSite attribute for the Set-Cookie response header instructs browsers to either restrict a cookie to first-party / same-site contexts or allow it in third-party / cross-site contexts.

In your browser devtools console, you may see an error such as the following:

A cookie associated with a cross-site resource at was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure.

For a Set-Cookie response header which lacks the SameSite attribute, browsers are beginning to treat the Set-Cookie response header as if it had a SameSite=Lax attribute — which causes browsers to ignore cookies sent in cross-origin fetch/XHR/axios, etc., requests.

Recent versions of modern browsers provide a more secure default for SameSite to your cookies and so the following message might appear in your console:

Cookie “myCookie” has “SameSite” policy set to “Lax” because it is missing a “SameSite” attribute, and “SameSite=Lax” is the default value for this attribute.

454 questions
4
votes
1 answer

What are the rules for SameSite=Lax cookies and GET request inside iframe?

The user is on site-a.com and there is an iframe with site-b.com. site-b.com makes GET request back to site-a.com (inside iframe). Will Lax cookies for cross-site GET to site-a.com be send with the request? To be more clear: Before GET request:…
CoperNick
  • 2,413
  • 2
  • 21
  • 26
4
votes
1 answer

Change SameSite attribute for FedAuth cookie?

I have a difficulty to change the SameSite attribute on an ASP.NET MVC application. Here is the scenario: I'm trying to load my ASP.NET application inside an iframe and because of the changes in Google Chrome 80+ I need to set the SameSite attribute…
Afshin
  • 149
  • 1
  • 2
  • 9
4
votes
2 answers

OpenIdConnectProtocolValidationContext.Nonce was null when using Okta in Asp.Net Web Application

I have a .Net Asp.Net WebApplication, I am trying to use Okta for Single Sign On capabilities. I have all my code working and running except when I use Google Chrome 80+ to sign in. When I sign on to Okta and am called back to my application I get…
MattyMerrix
  • 10,793
  • 5
  • 22
  • 32
4
votes
1 answer

How do I prevent the "cookie associated with a cross-site resource set without SameSite attribute" warning when making AJAX Cross origin requests?

So, I have two sites http://localhost/ and http://3rdPartyLocallyHostedAPI/ (Not the real names) - both are local intranet sites, and due to the nature of 3rdPartyLocallyHostedAPI being it's namesake, localhost is having to make CORS requests to…
Jake H
  • 155
  • 2
  • 13
4
votes
0 answers

document.cookie and Chrome's SameSite/Secure restrictions

I am attempting to follow the new guidelines for Cross Site Cookies and passing the SameSite=None; Secure attributes with cookies as I attempt to set them in browser Javascript code. We are sending our SSO/Authorization javascript bundle from a…
Devlin
  • 41
  • 3
4
votes
1 answer

Samesite cookie and Owin

To be compatible with Chrome 80- version, We have Implemented Same site Cookies for OWIN application with reference https://learn.microsoft.com/en-us/aspnet/samesite/owin-samesite We have: upgrade owin to 4.1 Target .net framework to .net…
Dao
  • 41
  • 3
4
votes
0 answers

How to handle SameSite attribute in Express with incompatible clients?

Chrome is changing the default value of SameSite cookie attribute from None to Lax as of its version 80. My site is embedded to another site using an iframe and the login session of my site is handled by express-session. For new browsers the…
Samuli Asmala
  • 1,755
  • 18
  • 24
4
votes
1 answer

How to edit a cookie set via mod_rewrite?

I use mod_rewrite to set some cookies and then redirect the user to the target url. As these cookies are used in a third party environment, I have to set the flag SameSite=none. I tried to edit the Set-Cookie header via mod_headers, but I didn't get…
Xoldomir
  • 71
  • 1
  • 4
4
votes
2 answers

How to set SameSite value to None or Undefined for OWIN OpenIdConnect.Nonce cookie on .NET 4.7.2

I'm running an ASP.NET MVC (4.7.2) web application. I authenticate externally with an Identity Server 4 instance with the Hybrid flow. When testing the new "missing SameSite defaults to LAX" feature of Firefox, he doesn't sent the LAX…
JonHendrix
  • 933
  • 15
  • 28
3
votes
1 answer

Render.com: HttpOnly Cookie not being set in browser storage when doing res.cookie between Web Services

I have a NestJs app that uses HttpOnly cookies for authentication. In development everything works perfectly. My NextJs client (http://localhost:4200) uses Graphql to send a login request to my NestJs server (http://localhost:3333), which sets…
Will Despard
  • 447
  • 1
  • 4
  • 17
3
votes
1 answer

PHP setcookie function including samesite parameter does not work

I have a fully working setcookie() php function running using these params... password), time() + 86400, '/', ); ?> The code above sets a cookie everytime with no issues! But as soon…
joshmoto
  • 4,472
  • 1
  • 26
  • 45
3
votes
1 answer

Configure a cookie to work with CORS, but only on subdomains

I'm trying to figure out a way to make cookie-based authentication work, when the frontend and the backend are two different subdomains, without exposing myself to the CSRF threat. Currently, i'm resorting to setting the cookie attribute sameSite to…
i.brod
  • 3,993
  • 11
  • 38
  • 74
3
votes
0 answers

SameSite Cookies None problems with Safari browser 14.1

My OS is Mojave 10.16.6, browser Safari 14.1.1. I ve developed an API with a token-based authentication. The token gets put into a cookie and is than sent to the browser and back to the server until logout. Here is the blog I used as blueprint:…
Heinz
  • 115
  • 2
  • 9
3
votes
2 answers

Will SameSite=None cookie be deprecated in the future?

I am creating a feature that will heavily depend upon cookies with SameSite=None and secure flag set to true as described in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite Cookies with SameSite=None must now also…
3
votes
2 answers

App reboots endlessly in Chrome 91 with cookies error in 'issues'

I develope web app, and yesterday faced issue related with cookies. Earlier our team dealth with it just disabling Cookies without SameSite must be secure and adding XSRF-TOKEN in cookies. I red…
deny Vice
  • 47
  • 1
  • 4