Possible to automatically refresh sessions? #2323
-
|
Services like Github seem to have longer sessions durations, at least I didn't have to log in there again. I suspect that in the background the sessions are updated automatically. Can something like this be implemented with Blitz? In the documentation i have already seen that you can adjust the session duration in the // blitz.config.js
const { sessionMiddleware } = require("blitz")
module.exports = {
middleware: [
sessionMiddleware({
sessionExpiryMinutes: 1234,
}),
],
}but this should not be set forever, right? Is there another way to automatically refresh sessions before they expire, so that the user doesn't have to log out and log in again? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Sessions are automatically refreshed once 1/4 of the expiry time has passed. So if a session is created today with expiry of 100 days, then any request between day 25 and day 100 will automatically refresh the session, extending the expiry out an additional 100 days. Default expiry time is 30 days, so users will stay logged in if they visit your app once a month. |
Beta Was this translation helpful? Give feedback.
Sessions are automatically refreshed once 1/4 of the expiry time has passed. So if a session is created today with expiry of 100 days, then any request between day 25 and day 100 will automatically refresh the session, extending the expiry out an additional 100 days.
Default expiry time is 30 days, so users will stay logged in if they visit your app once a month.