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
10
votes
4 answers

Spring: Unable to set SameSite cookie to None

I'm unable to set SameSite cookie value to None. Following is how i'm generating ResponseCookie object. ResponseCookie cookie = ResponseCookie.from("Hb", cookieUserId) .maxAge(!isEmpty(cookieUserId) ? MAX_COOKIE_DURATION : 0) …
Ahmad.Masood
  • 1,289
  • 3
  • 21
  • 40
10
votes
1 answer

Previously set "Samesite: Strict" cookie not available in document.cookie Firefox and Safari

We have a cookie set for XSRF/CSRF at the beginning of a user's session. At some point the user navigates to different domain (e.g. for payment), performs some actions, and navigates to our domain. Upon returning to our domain, Firefox and Safari…
Spork
  • 1,631
  • 1
  • 21
  • 37
9
votes
4 answers

Python session SAMESITE=None not being set

I am having issues with chrome and SameSite. I am serving a webpage in a shopify iframe and when setting the session using flask-login, chrome tells me this: A cookie associated with a cross-site resource at URL was set without the SameSite…
9
votes
0 answers

Is it safe to disable antiforgery token if samesite=strict on authentication cookie?

According to learn.microsoft.com ASP.NET core implements the Synchronizer Token Pattern to mitigate CSRF. The Anti request forgery mechanism has many drawbacks impacting users: ex 1: login page opened in 2 tabs Open the login page in two different…
Yanal-Yves Fargialla
  • 1,257
  • 15
  • 16
8
votes
1 answer

Disable sameSite cookie policy in Firefox (developer edition)

There's cases I when I want to run my front end as localhost and have it connect to a remote server for API requests. However, when trying to set cookies, Firefox won't allow it in cases where sameSite="Lax". It shows: "Some cookies are misusing the…
Tim Daubenschütz
  • 2,053
  • 6
  • 23
  • 39
8
votes
1 answer

Feasibility of SSO with SameSite Lax cookies, only?

Background I was toying with the aspect of implementing SameSite for my cookies today. I already had HttpOnly and Secure so I thought this probably wouldn't be a big deal. Why It Broke Well, it turned out that lots of things broke once I implemented…
InterLinked
  • 1,247
  • 2
  • 18
  • 50
8
votes
0 answers

sameSite=None; Secure still facing issue on Safari versions above 13

Even after adding sameSite=None; Secure , latest safari version 13 on MacOS 10.15 , still seeing an issue of session timed out with third party cookies, and chrome works really well with this approach. Is this expected ? for sure no from below…
vij
  • 81
  • 1
  • 3
8
votes
1 answer

Google Analytics blocked in IFrame due to "SameSite" & "Secure" setting of cookies

We're running a service on our-site.com. Our customers can either use the service "stand alone" by simply linking from their-site.com to our-site.com/customer-service or by embedding our service via iFrame into their-site.com. Imagine visiting GMaps…
suamikim
  • 5,350
  • 9
  • 40
  • 75
8
votes
1 answer

How can I setup a local environment to work with the latest SameSite cookie change to Chrome?

I'm building an app with ReactJS and with the latest change to Chrome we're unable to get the cookie back as it's provided by a Central Authentication Service. Granted, in prod it'll have the same domain as the JS app, but for now it is breaking the…
8
votes
1 answer

How to set SameSite cookie for YouTube in Laravel 5.8

I load YouTube videos in iframes on my website using Laravel 5.8.17. Peeking in the console I'm getting this warning: A cookie associated with a cross-site resource at http://youtube.com/ was set without the SameSite attribute. A future release…
Ansjovis86
  • 1,506
  • 5
  • 17
  • 48
8
votes
1 answer

How to set vaue of attribute samesite on the cookie __RequestVerificationToken_Lw__

I have an antirforgery token(@Html.AntiForgeryToken()) on a cshtml page, which generates a cookie RequestVerificationToken_Lw. The attribute values on this cookie are HTTP and Secure. But I need the SameSite also to be set. How do I achieve…
user2990342
  • 91
  • 1
  • 3
7
votes
1 answer

Does setting cookies 'SameSite=none; Secure' and providing CSRF-TOKEN suffice to prevent CSRF in embeddable web application?

My web application (myApp further) is embedded in iframe of a single third-party webpage. MyApp sets cookie Set-Cookie: JSESSIONID=38FE580EE7D8CACA581532DD37A19182; Path=/myapi; Secure; HttpOnly for maintaining users sessions. Sometime ago it…
Denis
  • 759
  • 1
  • 9
  • 22
7
votes
2 answers

Firefox samesite cookie

A cookie has been set with the SameSite=Strict attribute. When Javascript tries to read the cookie before making an XHR request the cookie seem to be unavailable. But the developer tools show the cookie exists. This problem is happening only in the…
Karthik
  • 99
  • 1
  • 5
6
votes
1 answer

Node.js, Angular, express-session: Chrome 80 does not save session because of cookie policy (sameSite cookies)

I have a Node.js, Angular app. (Node.js server written in TypeScript). Node.js Server is running on an Amazon EC-2 instance, the Angular client is on another server. For the login session, I use express-session. I am not using cookies in the app, so…
6
votes
1 answer

Confusion regarding SameSite changes with Chrome

I need some help understanding a case which I can not find described in material I have found describing the new SameSite restrictions for Chrome. Currently, I have a case where I have a site hosted which makes cross-site requests to an API. The…
Goblinlord
  • 3,290
  • 1
  • 20
  • 24
1 2
3
30 31