g3w-suite / g3w-admin

Server module for G3W-SUITE
https://g3w-suite.readthedocs.io/en/latest/g3wsuite_administration.html
Mozilla Public License 2.0
39 stars 31 forks source link

Cookie `“g3wclientsessiontoken”` does not have a proper `“SameSite”` attribute value. #791

Closed Raruto closed 2 months ago

Raruto commented 3 months ago

Checklist

Subject of the issue

Should be fixed in future releases:

Cookie “g3wclientsessiontoken” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

Steps to reproduce

image

image

Environment

[g3wsdk.info]

Link to your project

https://v37.g3wsuite.it/it/map/demo-37/

Additional info

No response

wlorenzetti commented 3 months ago

@Raruto test now if is it correct.

Raruto commented 3 months ago

@wlorenzetti nothing has changed for: https://v37.g3wsuite.it/it/map/demo-37/.

If I remember correctly it had been managed in here somehow: portal/apps.py#L17-L31

BTW, I think it could have greater implications (better not to work for it in 3.7/3.8).

Raruto commented 3 months ago

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

Note: A Secure cookie is only sent to the server with an encrypted request over the HTTPS protocol. Note that insecure sites (http:) can't set cookies with the Secure directive, and therefore can't use SameSite=None.

@wlorenzetti ref: https://github.com/g3w-suite/g3w-admin/pull/793