Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <sessionState
- cookieless="UseCookies"
- regenerateExpiredSessionId="true"
- mode="InProc"
- timeout="20"/>
- <pages enableSessionState="true">
- <pages enableSessionState="true">
- <namespaces>
- <add namespace="..."/>
- </namespaces>
- </pages>
- Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
- ' Fires when the session is started
- End Sub
- Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
- ' Fires when the session ends
- End Sub
- public class MySession
- {
- public static void Add(string key, object value)
- {
- if (HttpContext.Current.Session != null && (HttpContext.Current.Session.Keys == null || (HttpContext.Current.Session.Keys != null && HttpContext.Current.Session[key] == null)))
- {
- HttpContext.Current.Session.Add(key, value);
- }
- }
- public static void Remove(string key)
- {
- ...
- }
- public static void Update(string key, object value)
- {
- ...
- }
- public static object GetValue(string key)
- {
- ...
- }
- }
Add Comment
Please, Sign In to add comment