Skip to content

Fix cookies not working cross-site (SameSite=None; Secure)

Eric Eastwood requested to merge 2441-same-site-none-cookies into develop

Fix cookies not working cross-site (SameSite=None; Secure)

Fix https://gitlab.com/gitlab-org/gitter/webapp/-/issues/2441

Dev notes


If you try to test locally in localhost dev, the cookie will be rejected because SameSite requires the Secure attribute with HTTPS. So we don't try to add SameSite in dev localhost.

This Set-Cookie was blocked because it had the "SameSite=None" attribute but did not have the "Secure" attribute, which is required in order to use "SameSite=None".

Testing strategy

  1. Visit https://beta.gitter.im/ and deploy this branch to beta-staging
  2. Clear your cookies on beta
  3. Turn on beta-staging, https://gitlab.com/gitlab-org/gitter/webapp/-/blob/develop/docs/developer-faq.md#toggle-between-betabeta-staging
  4. Sign in to beta-staging
  5. Open the chrome devtools -> Application -> Cookies
  6. Notice the SameSite column and the None values

Edited by Eric Eastwood

Merge request reports