Samesite attribute in cookies

38 views
Skip to first unread message

agent tresdev

unread,
Aug 1, 2020, 1:02:28 AM8/1/20
to web2py-users
I have this warning in the Firefox console:

Cookie “session_id_app_name” will be soon rejected because it has the “sameSite” attribute set to “none” or an invalid value, without the “secure” attribute. To know more about the “sameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

So, does anybody if that could potentially become an issue? and if so, how does one go about setting the “sameSite” attribute

Jose C

unread,
Aug 8, 2020, 4:14:36 AM8/8/20
to web2py-users
What version of web2py are you using?  At least from 2.18.5+ it specifically defaults to samesite Lax (and you would have to call session.samesite(False) to override the Lax setting). 

You could try put session.samesite('Lax') somewhere in your model and see if that resolves the issue.

You can try putting session.secure() in a model (if your site uses https).

You can also have a peek inside gluons/globals.py, specifically the Session class definition, to see what your web2py is doing with the samesite setting by default.


HTH,

agent tresdev

unread,
Aug 8, 2020, 11:48:28 AM8/8/20
to web2py-users
Excellent and thanks for your answer,  i didn't know where to search in the code
Reply all
Reply to author
Forward
0 new messages