/// <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); }