Get {@link UserSessionManager} instance.
Create user session.
After session creation, sets session id in the response
cookies and/or headers, depending on the device from where request was sent.
Incoming HTTP request.
Outgoing HTTP response.
Subject.
Explicit session ttl, has priority over default one.
Delete user session.
Refresh Token will be extracted from request according to UserSessionOptions.
Incoming HTTP request.
Outgoing HTTP response.
Subject which has the session that needs to be deleted.
Id of the session to be deleted.
This parameter is optional, and should be mainly by admins to forcefully end user session.
CAUTION! When this param is set, you will most probably want to set unsetSessionCookie
to false in order to not invalidate session id cookie of the admin.
Whether to unset session cookie in the res
after session deletion.
This is valid only for requests made from browser devices.
More information about cookie invalidation can be found here.
Renew user session, by deleting the old one and creating a new one.
Incoming HTTP request.
Outgoing HTTP response.
Subject.
User session metadata.
Verify user session.
Session id will be extracted from request according to UserSessionOptions.
Depending on the {@link UserSessionManager} config, user session might be renewed, and the new user session id
will be set in the headers of response object. Therefore, it's very important that response is sent to client
with renewed session id at least.
Incoming HTTP request.
Outgoing HTTP response.
Subject.
Whether to unset session cookie in the res
in case it is not found/expired.
This is valid only for requests made from browser devices.
More information about cookie invalidation can be found here.
Cookie User Session middleware which uses lib.user-session for session management and HTTP protocol as transport of session id.
Notice that all function members that operate on HTTP response, will set/unset only it's headers, while other parts, like status code, payload etc are left untouched. Also it doesn't send response back to clients, this is the caller job to call
send
on response.Caller should also handle all of the exceptions (own and of other libraries) thrown by the methods of this class.