Created
July 15, 2014 13:38
-
-
Save adrianvlupu/40061225235d717b1b07 to your computer and use it in GitHub Desktop.
A session wrapper class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SessionManager | |
{ | |
#region Instance | |
private SessionManager() { } | |
private const string SESSIONKEY = "SessionManager"; | |
public static SessionManager Current | |
{ | |
get | |
{ | |
SessionManager instance = (SessionManager)HttpContext.Current.Session[SESSIONKEY]; | |
if (instance == null) | |
{ | |
instance = new SessionManager(); | |
HttpContext.Current.Session[SESSIONKEY] = instance; | |
} | |
return instance; | |
} | |
} | |
#endregion | |
public string Username { get; set; } | |
public string Password { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment