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

Chrome Extention: Unchecked runtime.lastError: Failed to parse or set cookie named "ASP.NET_SessionId"

I have developed a Chrome extention that modifies web pages for an ASP.net system used at my workplace. Due to the new Cookie restrictions introduced in recent versions of Chrome, I have to remove the SameSite lax cookie and replace it with a…
user3758291
  • 129
  • 1
  • 8
3
votes
1 answer

How to set HttpCookie Samesite attribute in .Net framework 4.0.30319?

I'm currently using .Net framework 4.0 in my application. Upon checking i could see that the samesite attribute is available only from .Net framework 4.7.2…
3
votes
2 answers

Samesite attribute of cookies set in response are not getting modifed by tomcat's cookieprocessor

Recently browsers are increasing security to prevent CSRF attacks via enhancing samesite cookie default value to Lax, i.e., if the samesite attribute is not set by the server while setting cookie via response set-cookie header, browser will consider…
Debojit Kundu
  • 111
  • 1
  • 13
3
votes
2 answers

Is there a way to add samesite value to a cookie in jquery?

I have been trying a few variations of syntax to attempt to get the cookie to update with the same site values and appear in chrome devtools like they do for this https://samesite-sandbox.glitch.me/ from chrome. None of them appear to work, using =…
P.Doohan
  • 45
  • 1
  • 6
3
votes
1 answer

Find the cookie that causes Chrome's SameSite warning

As some of you know, Chrome will start using a new SameSite cookie policy this month (https://web.dev/samesite-cookies-explained/ and https://www.chromium.org/updates/same-site). We are using Auth0 for our App and have seen this SameCookie warning…
Waruyama
  • 3,267
  • 1
  • 32
  • 42
3
votes
2 answers

Setting SameSite=None and Secure in ASP.NET

Read about the SameSite changes enforced to prevent Cross-Site Forgery. Source: https://blog.chromium.org/2019/10/developers-get-ready-for-new.html I'm trying to set its value to "None" and use Secure as advertised. My current web.config setting is…
3
votes
3 answers

samesite none in thirdparty shopify app not working

we are trying to set the samesite=none;secure in shopify app which is opening in iframe but we realised that it is being blocked by google chrome. we are testing chrome 80 beta we tried javascript and php but nothing is working. app is embeded app…
sonutup
  • 57
  • 7
3
votes
2 answers

C# SameSite flag issue

As Chrome is going to make the SameSite=None and Secure flag mandatory from 80 version on 4th Feb, I am try to set this flags in my cookie using the following lines of code: HttpCookie myCookie = new HttpCookie("XYZ"); myCookie.Value =…
krunal maniar
  • 31
  • 1
  • 4
3
votes
1 answer

How Can I Configure the SameSite Cookie Attribute in Apache Shiro?

I'm developing an EJB-based webservice using Apache Shiro for user access management. I added the freshly released version 1.5.0 of Apache Shiro to my Maven project to make use of the new sameSite cookie attribute. Then I added the configuration of…
Joe7
  • 508
  • 1
  • 4
  • 17
3
votes
1 answer

Condtionally set ASP.NET session and authentication cookies samesite value based on browsers

I have done the following changes to my web.config and I'm able to server both the authentication and the session cookie with samesite=none and secure. the problem is for browsers such as chrome 51-66 sending samesite=none invalidates the cookie and…
NicoTek
  • 1,127
  • 1
  • 14
  • 34
3
votes
2 answers

Getting "Unrecognized SameSiteMode value -1" InvalidOperationException in ASP.NET Core 3.1 Web Application

I'm running some tests to prepare for the upcoming Chrome version with the changes to SameSite handling of cookies, but my web application is giving trouble. I can reproduce it in the following way: Use Visual Studio 2019 (16.4.3) to create a new…
Jeroen
  • 60,696
  • 40
  • 206
  • 339
3
votes
2 answers

A cookie associated with a resource at http://doubleclick.net/ was set with `SameSite=None` but without `Secure`. A future release of Chrome

I have an .net core 2.2 project and I get this warning on google chrome: A cookie associated with a resource at http://doubleclick.net/ was set with SameSite=None but without Secure. A future release of Chrome will only deliver cookies marked…
BASKA
  • 311
  • 4
  • 15
2
votes
1 answer

SameSite=Strict cookies and cross-site requests with redirections

Cross-site requests do not include same-site cookies, but what happens if such a request leads to a redirection within the target site? I tested this with the following Node.js express app running on https://site-a.com: app.get("/a", function(req,…
Heiko Theißen
  • 12,807
  • 2
  • 7
  • 31
2
votes
1 answer

Why are my cross site cookies not working?

I have been working on a uni project and I'm getting really stuck on why the cross site authentication cookie from our backend isn't set when I do a CORS request to it from our backend. Our setup is as follows: A frontend on…
age992
  • 21
  • 2
2
votes
1 answer

Shopify Embedded App gets same_site_cookies error

Does anyone encountered issue embedding Rails app to Shopify? I keep getting oauth_error=same_site_cookies from Shopify. I tried to install gem "rails_same_site_cookie" also tried to update Rails config for session_store…
aldrien.h
  • 3,437
  • 2
  • 30
  • 52