You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I set a timeout on my session? I'm using sessions in combination with headers as said in the document (better for api/xhr). But I can't seem to find anything on how to expire my session after some time.
My session class looks like:
classSession(valname:String, valrole:Role) : Principal
FWIW, I was able to work around this by defining my own SessionTracker.
class MySessionTracker : SessionTracker<MySession> {
override suspend fun load(call: ApplicationCall, transport: String?): MySession? {
// your session loading logic here
// can check for expiration and return null if expired
// return the session if valid
}
override suspend fun store(call: ApplicationCall, value: MySession): String {
// your session storing logic here
// return the session ID
}
override suspend fun clear(call: ApplicationCall) {
// your session invalidation logic here
}
override fun validate(value: MySession) {
// any other validation to perform when being set
}
}
Unfortunately the builder functions on the Sessions feature don't allow for specifying your own SessionTracker, so you have to do something like this:
How can I set a timeout on my session? I'm using sessions in combination with headers as said in the document (better for api/xhr). But I can't seem to find anything on how to expire my session after some time.
My session class looks like:
The text was updated successfully, but these errors were encountered: