예제 #1
0
 public static void CreateValueSession(Settings.Session session, string value)
 {
     if (HttpContext.Current.Request.Cookies[session.ToString()] == null)
     {
         HttpCookie cookie = new HttpCookie(session.ToString())
         {
             Value   = value,
             Expires = DateTime.Now.AddHours(Int32.Parse(Settings.GetKey(Settings.KEY.timeSession)))
         };
         HttpContext.Current.Response.Cookies.Add(cookie);
     }
     else
     {
         HttpContext.Current.Response.Cookies[session.ToString()].Value   = value;
         HttpContext.Current.Response.Cookies[session.ToString()].Expires = DateTime.Now.AddHours(Int32.Parse(Settings.GetKey(Settings.KEY.timeSession)));
     }
 }
예제 #2
0
 public static Object GetValueSession(Settings.Session session)
 {
     return(HttpContext.Current.Request.Cookies[session.ToString()].Value);
 }
예제 #3
0
 public static void DestroyValueSession(Settings.Session session)
 {
     System.Web.HttpContext.Current.Request.Cookies.Remove(session.ToString());
 }