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

Allow MaxAge 0 to mean session-based cookie and not delete. #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

harperj1029
Copy link

No description provided.

@elithrar elithrar self-assigned this Nov 27, 2018
@elithrar
Copy link
Contributor

This won't work as intended, as setting a MaxAge of 0 means that the backing Redis store will try to call SETEX with a TTL of 0, which is invalid -

_, err = conn.Do("SETEX", s.keyPrefix+session.ID, age, b)

The challenge is that a "session cookie" with a server-side store requires you to make an assumption about how long your backing store should hold onto the cookie. If you set the MaxAge on the client-side cookie as 0, you're likely to want some short-lived-but-not-too-short-because-they-might-leave-their-tab-open TTL on the server side.

Copy link
Contributor

@elithrar elithrar left a comment

Choose a reason for hiding this comment

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

Requires design for the server-side TTL.

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.

3 participants