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

[bug] Default MaxAge never applies #119

Closed
betawaffle opened this issue Aug 12, 2019 · 4 comments · Fixed by #120
Closed

[bug] Default MaxAge never applies #119

betawaffle opened this issue Aug 12, 2019 · 4 comments · Fixed by #120
Assignees
Labels

Comments

@betawaffle
Copy link

Describe the bug

Ever since #38, the default MaxAge of 12 hours has not applied, because the check ignores zero.

For us, the current behavior is fine, we actually want session lifetime, but the documentation should be updated, or the default should apply when there is no explicit option given. Perhaps a good idea would be to move the defaulting into parseOptions instead?

Versions

We found this behavior in v1.6.0, but the bug was introduced in #38.

Steps to Reproduce

Use csrf.Protect without specifying the MaxAge option.

Expected behavior

The Max-Age property on the cookie should be whatever the documentation says the default will be.

@betawaffle betawaffle added the bug label Aug 12, 2019
@betawaffle
Copy link
Author

Sorry, I meant it was introduced in #39.

@elithrar
Copy link
Contributor

elithrar commented Aug 15, 2019 via email

@betawaffle
Copy link
Author

We are now. We weren't before, and I have no idea what other people are doing. I suspect, based on what we did, that people who didn't specify it assumed the docs were correct, and that the default of 12 hours was in place.

@elithrar
Copy link
Contributor

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

Successfully merging a pull request may close this issue.

2 participants