NickName:Keith Adler Ask DateTime:2009-08-27T02:52:38 Determine if ASP.NET Sessions are enabled What is the best way to do a boolean test in C# to determine if ASP.NET sessions are enabled? I don't want to use a try-catch block and Sessions != null throws an Exception. Regards. Copyright Notice:Content Author:「Keith Adler」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.Link to original article:https://stackoverflow.com/questions/1336770/determine-if-asp-net-sessions-are-enabled Answers John Rasch 2009-08-26T19:21:35 You will not get an exception if you use HttpContext.Current:\n\nif(HttpContext.Current.Session != null)\n{\n // Session!\n}\n",