Skip to content

What is the recommended way for session refresh? #3837

Answered by MichaelMarner
HyunnoH asked this question in Q&A
Discussion options

You must be logged in to vote

Refreshing the session by starting a new login flow with ?refresh=true will force the user to re-enter their password. This is good for cases where you want to re-verify the user, such as when they are about to perform some destructive action.

However, it isn't the right approach to just keeping a session active, which you want to happen transparently to the user in the background.

The way we have dealt with this is our API has an extend session, which in turn calls Kratos's backend API extendSession method. We have our apps configured so that on startup they call this API to extend the session. This works fine for our requirement of "user stays logged in for up to 2 weeks of inactivity".

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@HyunnoH
Comment options

@MichaelMarner
Comment options

Answer selected by HyunnoH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants