Skip to content

Use SameSite=Lax setting for cookies#189

Merged
sbc100 merged 1 commit intomasterfrom
fix-secure-cookies
Jun 21, 2016
Merged

Use SameSite=Lax setting for cookies#189
sbc100 merged 1 commit intomasterfrom
fix-secure-cookies

Conversation

@monfresh
Copy link
Copy Markdown
Contributor

Why: Using the SameSite=Strict setting was breaking our app due to
this Chrome bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=619603

Sessions were not properly being set and persisting, which was causing
the SAML auth flow to end prematurely in production because we rely on
the session[:saml_request_url] variable to continue the auth after
the user signs in.

**Why**: Using the SameSite=Strict setting was breaking our app due to
this Chrome bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=619603

Sessions were not properly being set and persisting, which was causing
the SAML auth flow to end prematurely in production because we rely on
the `session[:saml_request_url]` variable to continue the auth after
the user signs in.
@sbc100 sbc100 merged commit 19df17c into master Jun 21, 2016
@sbc100 sbc100 deleted the fix-secure-cookies branch June 21, 2016 18:29
monfresh added a commit that referenced this pull request Mar 30, 2017
**Why**:
- There is a bug in Chrome that causes the session to be reset in the
following scenario:

  - Set cookies to use SameSite=Strict
  - Have Gmail open in a tab
  - In a different tab, visit sp.qa.login.gov and click Login.gov
  - Click "Get started" and enter your Gmail address
  - In the Gmail tab, click on the confirmation link in the email
  - In this new tab that was opened, complete the account setup

Result: You are redirected to the profile instead of `sign_up/completed`

We had originally set the setting to `Lax` due to this Chrome bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=619603
See #189

Because that bug was closed in July 2016, we thought that it was safe
to go back to `Strict`, but it sounds like this might be a different
bug, or perhaps that original one hasn't really been fixed.

This bug only happens in Chrome, and seems to only happen when you click
the confirmation link from Gmail. If you copy and paste the link in a
new tab that you open manually, the redirect back to SP works fine.
Similarly, if you click the link from a non-Gmail email website, it
doesn't reset the session when it opens a new tab. I only tried
fastmail.com though.
pkarman pushed a commit that referenced this pull request Mar 31, 2017
**Why**:
- There is a bug in Chrome that causes the session to be reset in the
following scenario:

  - Set cookies to use SameSite=Strict
  - Have Gmail open in a tab
  - In a different tab, visit sp.qa.login.gov and click Login.gov
  - Click "Get started" and enter your Gmail address
  - In the Gmail tab, click on the confirmation link in the email
  - In this new tab that was opened, complete the account setup

Result: You are redirected to the profile instead of `sign_up/completed`

We had originally set the setting to `Lax` due to this Chrome bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=619603
See #189

Because that bug was closed in July 2016, we thought that it was safe
to go back to `Strict`, but it sounds like this might be a different
bug, or perhaps that original one hasn't really been fixed.

This bug only happens in Chrome, and seems to only happen when you click
the confirmation link from Gmail. If you copy and paste the link in a
new tab that you open manually, the redirect back to SP works fine.
Similarly, if you click the link from a non-Gmail email website, it
doesn't reset the session when it opens a new tab. I only tried
fastmail.com though.
pkarman pushed a commit that referenced this pull request Mar 31, 2017
**Why**:
- There is a bug in Chrome that causes the session to be reset in the
following scenario:

  - Set cookies to use SameSite=Strict
  - Have Gmail open in a tab
  - In a different tab, visit sp.qa.login.gov and click Login.gov
  - Click "Get started" and enter your Gmail address
  - In the Gmail tab, click on the confirmation link in the email
  - In this new tab that was opened, complete the account setup

Result: You are redirected to the profile instead of `sign_up/completed`

We had originally set the setting to `Lax` due to this Chrome bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=619603
See #189

Because that bug was closed in July 2016, we thought that it was safe
to go back to `Strict`, but it sounds like this might be a different
bug, or perhaps that original one hasn't really been fixed.

This bug only happens in Chrome, and seems to only happen when you click
the confirmation link from Gmail. If you copy and paste the link in a
new tab that you open manually, the redirect back to SP works fine.
Similarly, if you click the link from a non-Gmail email website, it
doesn't reset the session when it opens a new tab. I only tried
fastmail.com though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants