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

Fix cookie max-age computation #6890

Merged
merged 1 commit into from Jan 19, 2017
Merged

Conversation

gmethvin
Copy link
Member

@gmethvin gmethvin commented Jan 17, 2017

Fixes #6888 by reading the raw max-age value from the cookie and setting that directly instead of using Math.max(maxAge, 0). It's valid to have negative Max-Age values, and this is needed to properly set Expires since maxAge is used to set both.

Needs backport to 2.5.x.

@@ -46,7 +46,7 @@ class ScalaResultsSpec extends PlaySpecification {
setCookies("preferences").value must be_==("blue")
setCookies("lang").value must be_==("fr")
setCookies("logged").maxAge must beSome
setCookies("logged").maxAge must beSome(0)
setCookies("logged").maxAge must beSome(-86400)
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a defined constant to this value and then also use it here and here?

@gmethvin
Copy link
Member Author

@marcospereira This should be fine to merge; the build failure doesn't look like a legitimate issue.

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.

None yet

2 participants