Frappe can't set a cookie's SameSite attribute to the string literal "None" because werkzeug is outdated
See original GitHub issueDescription of the issue
Cookies may need the “SameSite” attribute set to the string literal “None”. They were set to None here, which means it defaults to “Lax” most of the time. It cannot be set to “None” unless werkzeug is updated to incorporate this change. I think therefore that frappe should use werkzeug 1.0.0 at least.
Context information (for bug reports)
I’m attempting to build a flutter application, which uses simple authentication. Hard-coding the changes described above, and the cookie’s “Secure” attribute allow me to retrieve the sid
cookie, and authenticate my users in development.
Output of bench version
WARN: bench is installed in editable mode!
This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`
5.0.0-dev
Steps to reproduce the issue
- Set up a frappe backend
- Set up a flutter client with the
withCredentials
attribute to send a login request - Send the login request
Observed result
The browser complains that the cookie could not be stored.
Expected result
The browser should just store the cookie, which flutter then handles.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
php - How to fix "set SameSite cookie to none" warning?
A cookie associated with a cross-site resource at (Here is my domain) was set without the SameSite attribute. A future release of Chrome...
Read more >Set samesite cookie attribute for PHP sessions - Drupal
Explicitly set the samesite cookie attribute (default: None). ... empty string, etc), the attribute won't be set at all (same behavior as ...
Read more >Request / Response Objects — Werkzeug Documentation (2.2 ...
Since Werkzeug 0.6 it's safe to use the same response object for multiple WSGI responses. It's possible to create copies using copy.deepcopy ....
Read more >SameSite cookies - HTTP - MDN Web Docs
Cookie "myCookie" rejected because it has the "SameSite=None" attribute but is missing the "secure" attribute. This Set-Cookie was blocked ...
Read more >The New cookieFlags Setting In Google Analytics - Simo Ahava
On top of these, in the latest version of the Google Chrome browser, the cookie will also be treated as having the SameSite=Lax...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ankush Thank you !!! So glad to hear that.
It’s unfortunate that ERPNext v13 can’t upgrade, but since there’s a workaround with nginx, this isn’t so bad.
Thank you @daraul for giving the workaround.
I took a wild guess based on this line and set the “device” parameter to “mobile” alongside my user’s login information. That did the trick, but I don’t recall seeing this functionality mentioned in the documentation. I would suggest the docs be updated in addition to werkzeug.