Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Our Session Cookie Better #8303

Merged
merged 1 commit into from
Jan 13, 2025
Merged

Conversation

jrjohnson
Copy link
Member

@jrjohnson jrjohnson commented Jan 10, 2025

This ilios-session cookie is used to store internal frontend authentication data. We don't use it to authenticate against the backend, we pass the X-JWT-Authorization header for that. As it's only ever used on the frontend, where it is generated, we should be able to restrict it to that domain (Strict). This has the added benefit of reducing our payload on each request as we're no longer sending our JWT twice.

Change is trivial, but please check my logic on this one.

We can also set this to Lax and restore our current default. Either way it will remove the annoying cookie warnings from the browser.

For reference: https://developer.mozilla.org/en-US/docs/Web/Security/Practical_implementation_guides/Cookies#samesite

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This `ilios-session` cookie is used to store internal frontend
authentication data. We don't use it to authenticate against the
backend, we pass the `X-JWT-Authorization` header for that. As it's only
ever used on the frontend, where it is generated, we should be able to
restrict it to that domain (Strict). This has the added benefit of
reducing our payload on each request as we're no longer sending our JWT
twice.
@jrjohnson jrjohnson marked this pull request as ready for review January 10, 2025 22:06
Copy link
Member

@stopfstedt stopfstedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jrjohnson jrjohnson added the run ui tests Run the expensive UI tests label Jan 13, 2025
@dartajax dartajax merged commit 2fb93a8 into ilios:master Jan 13, 2025
43 of 44 checks passed
@jrjohnson jrjohnson deleted the esa-samesite branch January 13, 2025 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run ui tests Run the expensive UI tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants