Nucleus .Net Core CMS

Managers.ISessionManager Interface

Namespace: Nucleus.Abstractions.Managers
Assembly: Nucleus.Abstractions.dll
Defines the interface for the session manager.

Remarks

Get an instance of this class from dependency injection by including a parameter in your class constructor.

Methods

CreateNew (Site,User,Boolean,IPAddress) Method

CreateNew (Nucleus.Abstractions.Models.Site,  Nucleus.Abstractions.Models.User,  System.Boolean,  System.Net.IPAddress)
Create a new Models.UserSession with default values.
Remarks
This function does not save the new Models.UserSession to the database. Call Save to save the role group.

Get (Guid) Method

Get (Guid id)
Retrieve an existing Models.UserSession from the database.
Parameters
Name Type
id Guid

Delete (UserSession) Method

Delete (UserSession userSession)
Delete the specified Models.UserSession from the database.
Parameters
Name Type
userSession Nucleus.Abstractions.Models.UserSession

Save (UserSession) Method

Save (UserSession userSession)
Create or update the specified Models.UserSession.
Parameters
Name Type
userSession Nucleus.Abstractions.Models.UserSession

SignIn (UserSession,HttpContext,String) Method

SignIn (UserSession userSession, HttpContext httpContext, String returnUrl)
Sign in the user represented by useSession.
Parameters
Name Type
userSession Nucleus.Abstractions.Models.UserSession
httpContext Microsoft.AspNetCore.Http.HttpContext
returnUrl String

SignOut (HttpContext) Method

SignOut (HttpContext httpContext)
Sign out the current user.
Parameters
Name Type
httpContext Microsoft.AspNetCore.Http.HttpContext

DeleteExpiredSessions

DeleteExpiredSessions ()
Remove all expired sessions.

CountUsersOnline (Site) Method

CountUsersOnline (Site site)
Return a count of active user sessions.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
Remarks
An active user session is defined as a session which has not expired, and has been updated in the last 5 minutes.