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

Cannot set expiration time in units other than days in shoptet.cookie.create #8

Open
MrVoltz opened this issue Feb 10, 2023 · 0 comments

Comments

@MrVoltz
Copy link

MrVoltz commented Feb 10, 2023

var maxAge = parseInt(defaultExpiration.days) * 24 * 60 * 60;

In shoptet.cookie.create both expires and max-age fields are set, but the computation of max-age doesn't take into account fields other than days.

From MDN:

Max-Age= Optional
Indicates the number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately. If both Expires and Max-Age are set, Max-Age has precedence.

max-age thus always has preference and the whole computation of expires is ignored, so only the days field is taken into account.

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

No branches or pull requests

1 participant