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

don't send Set-Cookie back from eventsource calls #1456

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

srabraham
Copy link
Member

@srabraham srabraham commented Dec 14, 2024

this fixes the below issue, in a minimally hacky way.
The eventsource call doesn't require authentication, and
when a client does automatic connection retries on this
endpoint, it'll sometimes get back a Set-Cookie value
for a brand new, unauthenticated Twisted session. That
cookie value can stomp over a valid, authenticated session
cookie that the client may already have. The result is that
a user can effectively be logged out after a session lasting
less than a minute. That's not desirable.

#1363

Copy link

codecov bot commented Dec 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 69.64%. Comparing base (52049e7) to head (d7ec66c).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/ims/application/_api.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1456      +/-   ##
==========================================
- Coverage   69.67%   69.64%   -0.03%     
==========================================
  Files         181      181              
  Lines        8995     8996       +1     
  Branches     1494     1494              
==========================================
- Hits         6267     6265       -2     
- Misses       2623     2625       +2     
- Partials      105      106       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

this fixes the below issue, in a minimally hacky way.
The eventsource call doesn't require authentication, and
when a client does automatic connection retries on this
endpoint, it'll sometimes get back a Set-Cookie value
for a brand new, unauthenticated Twisted session. That
cookie value can stomp over a valid, authenticated session
cookie that the client may already have. The result is that
a user can effectively be logged out after a session lasting
less than a minute. That's not desirable.

#1363
@srabraham srabraham changed the title don't start new Twisted Sessions for eventsource calls don't send Set-Cookie back from eventsource calls Dec 15, 2024
@srabraham srabraham enabled auto-merge (rebase) December 15, 2024 13:02
@srabraham srabraham merged commit 682f2ed into master Dec 15, 2024
11 checks passed
@srabraham srabraham deleted the 2024-12-12-not-auth branch December 15, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants