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
17
votes
3 answers

How to set sameSite cookie in Tomcat's cookie processor?

Tomcat's context.xml defines CookieProcessor (default LegacyCookieProcessor). Apache Tomcat 9 Configuration Reference I'm trying to add attribute(s) shown on cookie processor, however that doesn't seems to be working
Puneri
  • 283
  • 1
  • 2
  • 10
16
votes
5 answers

"SameSite=none" does not work with iframe

After upgrade to Chrome Version 80.0.3987.132 cookies are not sent to the iframe request. On the Network tab (Chrome Dev tools), I do not see cookies for my requests. After turning on the option "show filtered out requests cookies" I sees my cookies…
Mikolay Bet
  • 173
  • 1
  • 1
  • 6
16
votes
2 answers

SameSite cookies, frames, sub domains and redirections

The SameSite concept for Cookies is definitely a hard one to grasp... In preparation for Chrome 80's changes, I'm trying to measure the impact of the absence of SameSite attribute on my cookies. I have the following configuration: User initially…
Gyum Fox
  • 3,287
  • 2
  • 41
  • 71
14
votes
2 answers

Session cookie set `SameSite=None; Secure;` does not work

I added SameSite=None; Secure; to set-cookie. but the cookie was not set and I can’t log in to my site. response.writeHead(200, { 'Content-Type': 'application/json', 'Set-Cookie': 'token=' + token + '; SameSite=None; Secure; Expires=' +…
mrbelane
  • 175
  • 1
  • 1
  • 7
14
votes
1 answer

SameSite=None not working on Chrome incognito?

I visited this site: https://samesite-sandbox.glitch.me/ both on normal and incognito Chrome window. This happens 100% of the time both on Mac Chrome and Android Chrome. Incognito had no extensions enabled. Is this a bug? Is there a…
user3058763
  • 489
  • 1
  • 5
  • 17
14
votes
1 answer

A cookie associated with a cross-site resource was set without the `SameSite` attribute

Chrome is giving me the following warning: A cookie associated with a cross-site resource at http://quilljs.com/ was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are…
Hooman Bahreini
  • 14,480
  • 11
  • 70
  • 137
13
votes
1 answer

What is top-level navigation in browser terminology and in what ways it can be triggered?

When reading about SameSite attribute I came across the term top-level navigation. As I understood it, it's when user has website1.com open in browser and then clicks the link that navigates browser to some other site eg. website2.com. But this is a…
mlst
  • 2,688
  • 7
  • 27
  • 57
13
votes
4 answers

How to set SameSite and Secure attribute to JSESSIONID cookie

I have a Spring Boot Web Application (Spring boot version 2.0.3.RELEASE) and running in an Apache Tomcat 8.5.5 server. With the recent security policy which has imposed by Google Chrome (Rolled out since 80.0), it is requested to apply the new…
ThilankaD
  • 1,021
  • 1
  • 13
  • 24
13
votes
2 answers

this set-cookie was blocked because it has the samesite=lax

Hello i have flask back end and vue front and i can not set cookie in browser.When I send cookie from flask to vue bruser give me worrning: This set-cookie was blocked because it has the samesite=lax attribute but come from cross-site response witch…
Vova Bes
  • 133
  • 1
  • 1
  • 5
13
votes
4 answers

How to overcome the effect of chrome's samesite cookie update in the case of localhost?

I have a website which requires authentication from another site to login. Both are different domains. I have enabled the samesite by default cookies flag from chrome://flags. Just to check how chrome's new update effects in my website. It is…
Invisible Coder
  • 139
  • 1
  • 1
  • 4
12
votes
3 answers

Same-site flags were removed in Chromium 91 - How can I disable them for local development?

Previously I could disable the verification of same-site cookie in the chrome://flags using the following flags (pic 1) but it seems that in Chromium 91 they were removed (pic 2). What can I do to disable this verification?
VitalyB
  • 12,397
  • 9
  • 72
  • 94
12
votes
2 answers

Samesite cookie but allow specific domain

I would like to secure my cookies using SameSite=strict. But is there a way to allow it to be accessed by few domains alone?
JC Raja
  • 5,597
  • 2
  • 18
  • 10
12
votes
6 answers

Adding 'SameSite=None;' cookies to Rails via Rack middleware?

On February 4th 2020, Google Chrome will require SameSite=None; to be added to all cross-site cookies. Rails 6.1 and soon Rails 6.0 have added a same_site: :none option to the rails cookie hash: cookies["foo"]= { value: "bar", expires:…
Kelsey Hannan
  • 2,857
  • 2
  • 30
  • 46
10
votes
2 answers

DOMException: Failed to read the 'localStorage' property from 'Window': In Chrome Incognito mode and running in Iframe

Can anyone please help me on this issue as I'm getting this same error message on my site when I run it inside iframe of a separate domain in incognito mode only? You can access site from here. No issue on non-incognito mode. No issue without…
Rahul
  • 1,063
  • 2
  • 11
  • 22
10
votes
6 answers

PHP SameSite session problem, session doesn't work

I hope anybody can give me some ideas to my problem. I am trying to apply SameSite cookie to make session work but it seems it doesn't work. The visited site html: Iframe source site: …
JohnyFree
  • 1,319
  • 3
  • 22
  • 35
1
2
3
30 31