Nucleus .Net Core CMS

Managers.ISessionManager Interface

Namespace: Nucleus.Abstractions.Managers
Assembly: Nucleus.Abstractions.dll
Defines the interface for the session manager.
Get an instance of this class from dependency injection by including a parameter in your class constructor.
BuildAuthenticationProperties (UserSession userSession)
Create a AuthenticationProperties instance using settings from userSession.
Parameters
Name Type
userSession Nucleus.Abstractions.Models.UserSession
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.
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.
Delete (UserSession userSession)
Delete the specified Models.UserSession from the database.
Parameters
Name Type
userSession Nucleus.Abstractions.Models.UserSession
DeleteExpiredSessions ()
Remove all expired sessions.
Get (Guid id)
Retrieve an existing Models.UserSession from the database.
Parameters
Name Type
id Guid
Save (UserSession userSession)
Create or update the specified Models.UserSession.
Parameters
Name Type
userSession Nucleus.Abstractions.Models.UserSession
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 httpContext)
Sign out the current user.
Parameters
Name Type
httpContext Microsoft.AspNetCore.Http.HttpContext