-
Notifications
You must be signed in to change notification settings - Fork 19
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
Unable to control cookie expiry (or cookie refresh) on a per generation basis #46
Comments
So this is necessary for th double submit cookie pattern, here's how
You don't need to generate a new token, by default, calling
Typically this is a side effect of the double submit pattern. so For example, you could have a token-per-request setup, or even a token-per-route setup.
The only stupid question is the one that is left unasked.. |
@psibean Thanks for your fast response. When you say the cookie stays in sync between browser tabs. If I refresh a page on tab 1 it gets the cookie back from the server with a new "Expire Date", but the expiry date does not get synced through browser tabs, causing where, for example a user are busy on an individual tab calling ajax calls the whole time will cause the cookie to basically never expires as long as the user is keeping it "alive". Now, the problem is, although this cookie is alive at the first tab, the other tab might have a cookie which already "expired". I want the session to be alive between all browser tabs, and, if a user session expired then all cookies should be destroyed between all tabs (So, basically sign the user out from all tabs). |
So the intention is that you should be in control of the cookie expiry, but now I can see that's not quite the case because It's obvious now, some of the cookie options should be exposed via I think this is a good opportunity to make the additional options passed into Will need to consider a default behaviour which will either:
|
I'll look at fixing this and releasing a new major version once I have. It needs a little bit of thought.
These two things might just work together naturally, but will see. Tests will also need to be written to test the cookie expiry is updated / maintained in all the permutations of new cases. |
A fix for this has been merged into master and will be released with the next major version 4.0.0, there's additional breaking changes to come before that release. This issue will remain open until it's released. |
Ok, In your example you are showing a single route /
Where you fire a /csrf-token to generate a new token whenever the route is loaded. My question is. Do I need to do this on all routes where I have multiple pages?
What I do not understand is the following:
Excuse if it sounds stupid, but I am new to this. I just need to understand in more detail.
The text was updated successfully, but these errors were encountered: