/// <summary> /// 获取Session /// </summary> /// <param name="key"></param> /// <returns></returns> public static object Get(Enumer.Session key) { string name = key.ToString(); var context = HttpContext.Current; if (context != null && context.Session != null) { return(HttpContext.Current.Session[name]); } return(null); }
/// <summary> /// 移除Session /// </summary> /// <param name="sessionKey"></param> public static void Remove(Enumer.Session sessionKey) { string key = sessionKey.ToString(); HttpContext.Current.Session.Remove(key); }
/// <summary> /// 保存用户Session /// </summary> /// <param name="sessionKey"></param> /// <param name="data"></param> public static void Set(Enumer.Session sessionKey, object data) { string key = sessionKey.ToString(); HttpContext.Current.Session[key] = data; }