/// <summary> /// 取出后删除 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="session"></param> /// <param name="key"></param> /// <returns></returns> public static T PopSession <T>(this HttpSessionState session, string key) { var value = session.GetSession <T>(key); session.RemoveSession(key); return(value); }
public static T PopSessionFromJsonOrDefault <T>(this HttpSessionState session, string key) { var value = session.GetObjectFromJsonOrDefault <T>(key); session.RemoveSession(key); return(value); }