HttpContext context = HttpContext.Current; //而后,再使用: if (context.Session["user"] != null) { } 转载于:https://www.cnblogs.com/ilookbo/p/4349666.html