protected void Session_Start(object sender, EventArgs e) { try { if (HttpContext.Current.Session["clientinfo]!=null)) { } else { //FormsAuthentication.SignOut(); //HttpContext.Current.Session.Abandon(); Response.Redirect("some page"); } } catch { } }
/// <summary> /// Method to check sesssion. /// </summary> /// <param name="sessionName"></param> /// <returns></returns> public static bool CheckSession(string sessionName) { if(!string.IsNullOrEmpty((string)HttpContext.Current.Session[sessionName])) { return true; } else { return false; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)