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

Cookies: automatic "expires" setting #107

Closed
jodosha opened this issue May 14, 2015 · 0 comments · Fixed by #110
Closed

Cookies: automatic "expires" setting #107

jodosha opened this issue May 14, 2015 · 0 comments · Fixed by #110
Assignees
Milestone

Comments

@jodosha
Copy link
Member

jodosha commented May 14, 2015

Old browsers (IE 6, 7, 8), don't support max-age setting.

If we set default :max_age from Lotus::Configuration, or we specify inline in a cookie cookie[:foo] = {value: 'bar', max_age: 300}, it will be ignored.

I think it's our role to provide transparent solutions to browsers quirks.
We should set expires automatically, when it isn't present, but max-age is.

# Do nothing
cookies[:foo] = 'bar'

# Do nothing
cookies[:foo] = { value: 'bar', expires: Time.parse('2015-05-14 12:01:00') }

# Automatically set expires 
cookies[:foo] = { value: 'bar', max_age: 120 }

See http://mrcoles.com/blog/cookies-max-age-vs-expires/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants