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

Prevent eager deletion of invalid persistent session cookie #366

Merged
merged 3 commits into from
Dec 30, 2019

Conversation

danschultzer
Copy link
Collaborator

Resolves #356

This prevent eager deletion of cookie. The cookie expiration date is set to 10 seconds in the future rather than 1 second in the past, so the cookie will automatically expires 10 seconds after the last request. This should give enough time in case there are a multitude of requests as described in #356 while rolling the persistent session.

I've also added the :persistent_session_cookie_opts to the cookie deletion and expiration.

@liamwhite
Copy link

liamwhite commented Dec 30, 2019

Could the time drift be configurable? Context: I have some users who use very high-latency internet connections, and I'm wondering if higher values for time drift would make more sense there.

@danschultzer
Copy link
Collaborator Author

Added :persistent_session_cookie_expiration_drift, but 10 seconds should be enough. High latency may actually be preferable since the problem is when the requests comes in quicker than the GenServer can finish the async update.

@danschultzer
Copy link
Collaborator Author

Renamed it to :persistent_session_cookie_expiration_timeout, I think drift doesn't really make sense.

@danschultzer danschultzer merged commit 87acd4f into master Dec 30, 2019
@danschultzer danschultzer deleted the eager-delete-bug branch December 30, 2019 18:56
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.

Strange behavior with persistent session
2 participants