-
Notifications
You must be signed in to change notification settings - Fork 10
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
Proposal: Support dynamic set cookies lifetime for each session when save #73
Comments
You should store your own cookie in the browser and use it to restore/start a session. There is nothing to do with this library. |
@alex-oleshkevich Currently, I do that. But if I want cookies to expire based on the browser session, the library needs to change a little. |
Can you elaborate a bit more? Maybe bring a MRE? |
what exactly is your use case? |
@alex-oleshkevich I'm working on implementing a "remember me" function for user logins. Here's how it should work:
The issue I'm facing is that the library only allows us to set the session lifetime when initializing the middleware. We can't dynamically set it for each user login session. |
Thanks. I will. |
all you need is
See here - https://github.com/alex-oleshkevich/kupala/blob/master/kupala/authentication.py#L46 You don't need to deal with sessions at all. |
Like Django, we can use the function set_expiry to set the lifetime for the session. It will be helpful when we implement the remember_me function.
Thanks in advance.
The text was updated successfully, but these errors were encountered: