Replies: 3 comments
-
One way you might be able to do this is with the CookieStore. You'd have to ensure the cookie is cleared (in the browser) when the window is closed but because the session state is stored entirely in the cookie that would blow away the session. |
Beta Was this translation helpful? Give feedback.
-
This is included in our 0.1.0 release of tower-sessions as a "session" cookie (not to be confused with the cookie we use for the session). When the expiration time is set to None the max-age attribute of the cookie will be "Session" which usually is handled by browsers as expiring when the user closes the browser (some browsers have session restoration, which can alter the semantics of this). |
Beta Was this translation helpful? Give feedback.
-
Thanks for creating
axum-sessions
andaxum-login
. I have a question: How to create one-shot session, that session will be destroyed after user closes the browser?I want to implement login mode where user will be logged out if he/she closes browser.
Beta Was this translation helpful? Give feedback.
All reactions