Cookie maxAge in stacks #3361
ezra-freedman
started this conversation in
Proposals
Replies: 1 comment
-
I think that's a bug in the template. As you've seen, a default of 0 is practically useless and should only be used to expire/delete cookies. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm curious why the Remix stacks all set
maxAge
to0
(expire immediately) in their calls tocreateCookieSessionStorage
.In the Indie Stack, the only time the template code sets a cookie, it specifies a value for
maxAge
, which overrides the initialization's value:I came across this because I was trying to add other data to the stack's
sessionStorage
and it wasn't persisting. It turns out that this was because I wasn't specifying a maxAge in my call tocommitSession
so the default of0
took precedence.Are there reasons one would want cookies to expire immediately? And even if there are, should that be the default in the stack?
Beta Was this translation helpful? Give feedback.
All reactions