Session Handle
A sessionHandle
is a unique ID for a session in your system. It stays the same during the entire lifetime a session - even though the actual access and refresh tokens keep changing.
How do you get a sessionHandle?
- If you are NOT using express, the
getSession
function returns an object that contains this value. - You can call the
getAllSessionHandlesForUser
function - If token theft is detected, then the
err
object will contain a sessionHandle.{errType: supertokens.Error.TOKEN_THEFT_DETECTED, err: { sessionHandle: string, userId: string }}