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
6
votes
1 answer

How to reduce SameSite cookie attribute back to None in ASP.NET?

In order to avoid CSRF (Cross-site request forgery) most browsers are (since late 2019) automatically considering that any cookie that does not explicitly define SameSite attribute will be considered as Lax, instead of None which was the previous…
drizin
  • 1,737
  • 1
  • 18
  • 44
6
votes
1 answer

Cookies without "SameSite" attribute are sent on different sub domains

So I've read about Chrome 80's cookies defaulting to SameSite=Lax and like the rest of you, I'm now trying to mesure the impact this will have on my site. The site I'm running is split on several sub-domains and each of them uses their own cookie.…
Gyum Fox
  • 3,287
  • 2
  • 41
  • 71
6
votes
2 answers

How to set SameSite cookie attribute using Apache configuration?

I am not able to see SameSite=Strict using builtin developer tools in the “Application” tab. I have added below Header code in Apache configuration Header always edit Set-Cookie (.*) "$1;SameSite=Strict" Header edit Set-Cookie ^(.*)$…
Abhishek Habbu
  • 61
  • 1
  • 1
  • 4
5
votes
0 answers

cookie issues while embedding youtube videos

embedding some youtube videos everything works fine but there are some issues in devtools - issues panel, like this: Indicate whether a cookie is intended to be set in a…
qadenza
  • 9,025
  • 18
  • 73
  • 126
5
votes
3 answers

How to set cookie attribute Samesite = None for .Net Framework earlier of 4.7.2 (for 4.5.2)

As per the recent update from Google Chrome, it only allows cross-platform cookies which having attribute sameSite=None Link: https://learn.microsoft.com/en-us/aspnet/samesite/system-web-samesite#net-versions-earlier-than-472 As per the above…
Smit Patel
  • 2,992
  • 1
  • 26
  • 44
5
votes
1 answer

How do I fix console message: Cookie "ARRAffinity" will be soon rejected?

I have a static website on an Azure web server/portal that holds our company's documentation. Recently, I've been making changes to our code that sets our cookies to ensure that they comply with the browser SameSite requirement as explained…
Jared
  • 179
  • 1
  • 10
5
votes
0 answers

How to make SameSite Cookie Support In ASP.NET 4.6.1 and below version

I have developed a site using asp.net M V C we did ran a scan on site and it gives a C S R F asking to make the site cookies Same site. tried below code in web.config but seems its works only from 4.7.1 on wards - Is there any way we can achieve…
rohit jena
  • 51
  • 1
  • 2
5
votes
1 answer

Will a cookie whose samesite=none and secure=true not set from Chrome 80?

I know the behavior about cookie is changed from chrome 80. https://blog.chromium.org/2019/10/developers-get-ready-for-new.html This blog says, "When the SameSite=None attribute is present, an additional Secure attribute must be used so cross-site…
Shuhei KOIKE
  • 53
  • 1
  • 4
5
votes
1 answer

SameSite attribute and Facebook SDK

I am trying to solve the warning that I get from Chrome browser: A cookie associated with a cross-site resource at http://www.facebook.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with…
armagedescu
  • 1,758
  • 2
  • 20
  • 31
5
votes
1 answer

How to enable chrome features from the command line?

I am trying to test fixes to a single sign-on process that is affected by Chrome's pending changes to the SameSite cookie attribute (see SameSite Updates). I can enable these two features in chrome://flags to ensure that chrome exhibits the new…
redcalx
  • 8,177
  • 4
  • 56
  • 105
5
votes
1 answer

Setting session_id cookie SameSite property in Rails

I am attempting to set the SameSite property in my session's cookie in my Rails 5.0.7.2 application but I am having problems determining where and how to set this up. It looks like a way of determining the SameSite protection level globally will be…
rii
  • 1,578
  • 1
  • 17
  • 22
5
votes
1 answer

Trying the SameSite attribute fix for the google recaptcha v2 warning on Chrome 77 doesn't seem to be working for me?

I apologize if I'm repeating this question but I've spent over 6 days on this and I'm losing my mind. I can't seem to get that warning to disappear even though I've meticulously tried and retried to add these in my php index before the and tags.…
4
votes
0 answers

Cross-origin request with 302 redirect doesn't set cookie on IOS for Chrome and FireFox

I have a hyperlink doing calling a node express API on heroku. The API sets a session cookie and redirects back the url of a single page application (frontend). The backend API is located on a different domain than the application frontend. This…
Jérémy
  • 41
  • 2
4
votes
4 answers

How do a make a cookie in Laravel and specify the SameSite attribute (Lax, None, Strict)?

I'm currently setting a cookie like this (in middleware): cookie()->queue("loginToken", $loginToken, 60*24*365*10); How do I specify SameSite = None? I'm using Laravel 8.
Magmatic
  • 1,754
  • 3
  • 19
  • 34
4
votes
3 answers

Safari 13+ blocks third-party cookies if API is on different subdomain

I have Web application and API application. These applications are hosted on different domains. Eg. WebApp: app.product.com API: api.product.com Cookies are set in Set-Cookie header in response to API call: api.product.com/SetCookie -> response…
smyq
  • 41
  • 1
  • 2