// package sessionmdl provides APIs to Add, Validate and Delete user sessions. These APIs must be used along with JWT Auth.
// If you want to use this functionality, a jwt token must contain `userId` and `sessionId` fields.
// A user can have multiple active sessions for different use cases. To check if user has an active session for particular usecase use `CheckForSessionAvailability()`.
// And to check user session on each request use `ValidateSessionFromToken()`.
//
// An in memory cache is used to store sessions. It automatically falls back to redis cache if -gridmode=1 is set.
//
// An `SessionInstance` is assigned a new ID on application start. Its users responsibility to send this value in `InstanceHeader` on each request, other than open.
// The expiraion of session must be same as of token expiration.
// InstanceHeader is used because we need to ensure that the request is from outdated instance.
// Ex. When the application restarts, it may get request from client which has previous `SessionInstance`
InstanceHeader="session-instance"
)
// ValidateSession is used to give user flexibility to use or not to use this feature.
// The set this on app start if you want to use session validation.
varValidateSessionbool
// SessionInstance is used to differentiate between current and previous instances. This must be set in client and sent in each request against `session-instance` header.
varSessionInstance=guidmdl.GetGUID()
// store is used to store sessions in memory, falls back to redis cache on grid mode.