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
244
votes
6 answers

SameSite warning Chrome 77

Since the last update, I'm having an error with cookies, related with SameSite attribute. The cookies are from third party developers (Fontawesome, jQuery, Google Analytics, Google reCaptcha, Google Fonts, etc.) The errors in the Chrome console are…
peiblox
  • 2,463
  • 2
  • 12
  • 7
107
votes
3 answers

What is the difference between SameSite="Lax" and SameSite="Strict"?

Can anyone tell me what is the difference between SameSite="Lax" and SameSite="Strict" by a nice example as I am a bit confused between these two?
Simant
  • 3,142
  • 4
  • 32
  • 61
47
votes
7 answers

Safari not sending cookie even after setting SameSite=None; Secure

Our application uses cookies to remember user login. Every auth API call we make, the browser attaches server-set HTTPonly cookie with the API request and gets authenticated. This behaviour seems to be broken in safari after Mojave release. I read…
DieOnTime
  • 493
  • 1
  • 5
  • 8
35
votes
2 answers

Where to add `SameSite=None`?

I got the following code in happening on my site, and I tried my best cant grasp this, so I have a couple questions, please read. category-search-Forum:1 A cookie associated with a cross-site resource at https://www.google.com/ was set without the…
Chaz Steiner
  • 447
  • 2
  • 5
  • 11
33
votes
6 answers

This Set-Cookie didn't specify a "SameSite" attribute and was default to "SameSite=Lax" - Localhost

I'm a front-end developer working on an application where the login/ response put a Session-Cookie on the client. The later request will be authorized since the user "logged in". Starting from Chrome 80 All cookies without a SameSite attribute will…
Gil Epshtain
  • 8,670
  • 7
  • 63
  • 89
33
votes
8 answers

how SameSite attribute added to my Asp.net_SessionID cookie automatically?

Recently samesite=lax add automatically to my session cookie! this attribute just add to sessionID: "Set-Cookie ASP.NET_SessionId=zana3mklplqwewhwvika2125; path=/; HttpOnly; **SameSite=Lax**" My website hosted on IIS 8.5, Windows 2012 R2, and dont…
Sadegh
  • 639
  • 1
  • 5
  • 14
28
votes
10 answers

Same-Site flag for session cookie in Spring Security

Is it possible to set Same-site Cookie flag in Spring Security? And if not, is it on a roadmap to add support, please? There is already support in some browsers (i.e. Chrome).
Tomáš Hála
  • 291
  • 1
  • 3
  • 4
27
votes
1 answer

Cross-site resource at was set without the `SameSite` attribute .NET

How to solve SameSite attribute? :1 A cookie associated with a cross-site resource at http://doubleclick.net/ was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with…
William M. Ramirez
  • 271
  • 1
  • 3
  • 3
26
votes
3 answers

issue with cross-site cookies: how to set cookie from backend to frontend

I'm currently developing my first webapp, frontend with React and backend with FastAPI. I'm trying to test it out jointly with Chrome-- see if the frontend makes the correct API calls to backend, and display the results. I've been having problems…
hainabaraka
  • 595
  • 2
  • 5
  • 13
23
votes
8 answers

How to set same-site cookie flag in Spring Boot?

Is it possible to set Same-Site Cookie flag in Spring Boot? My problem in Chrome: A cookie associated with a cross-site resource at http://google.com/ was set without the SameSite attribute. A future release of Chrome will only deliver cookies with…
Nikolas Soares
  • 479
  • 2
  • 4
  • 13
21
votes
2 answers

Samesite cookie attribute not being set using javascript

I am trying to set SameSite attribute using javascript on my site . The code is The cookie is being…
Satya
  • 8,693
  • 5
  • 34
  • 55
20
votes
2 answers

Setting Google Tag Manager cookies with SameSite and Secure attributes

Chrome is reporting the following warning: A cookie associated with a cross-site resource at https://www.googletagmanager.com/ was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if…
19
votes
4 answers

How can I resolve a cross-site Google Analytics cookie `SameSite=None` warning in Chrome on Apache 2.4 and PHP 7.1?

My client's website is getting these SameSite cookie warnings in Chrome. I've searched all over and I can't get the warnings to go away. The cookies are due to Google Ad Conversion Tracking on a Wordpress Site. The site is on a Apache/2.4.7…
Benson
  • 4,181
  • 2
  • 26
  • 44
19
votes
2 answers

How to explicitly set samesite=None on a flask response

Due to changes arriving in Chrome during July, I need to modify my app to explicitly provide the SameSite=None key value. This is due to the RFC treating the absence of this setting in a more impacting way than if it is present but set to None. …
Mark Ruse
  • 387
  • 1
  • 4
  • 12
17
votes
2 answers

The 'sameSite' attribute is not allowed in web.config Asp.net Web project with framework 4.8

I been trying to add sameSite = None attribute to my project cookies as a part of Chrome standards. I am using .net framework 4.8 and it supports sameSite for cookie…
1
2 3
30 31