protected void Page_Init()
{
Browser.ClearBrowserData();
}
protected void Page_Load(object sender, EventArgs e)
{
HtmlMeta meta = new HtmlMeta();
meta.HttpEquiv = "Refresh";
meta.Content = Convert.ToString(Session.Timeout * 60) + ";url=Logout.aspx";
this.Page.Header.Controls.Add(meta);
Page.Title = ":::ESDM ADMIN:::";
try
{
if (Session["adminsession"] != null && Convert.ToString(Session["adminsession"]).Length > 1)
{
if (Session["admincookiessession"] != null && Session["admincookiessession"].ToString().Length > 0 && Convert.ToString(Session["admincookiessession"]) == Convert.ToString(Request.Cookies["adminCookies"].Value))
{
lb_user.Text = Session["adminsession"].ToString();
}
else
{
//FormsAuthentication.SignOut();
//Request.Cookies.Remove("adminCookies");
//new Cookies().RemoveCookies("adminCookies");
//Response.Redirect("~/Login.aspx?message=" + "Invalid Session");
//Cookies.ClearAllCookies();
FormsAuthentication.SignOut();
Request.Cookies.Remove("adminCookies");
new Cookies().RemoveCookies("adminCookies");
Session.RemoveAll();
Response.Redirect("~/Login.aspx");
}
}
else
{
// Cookies.ClearAllCookies();
FormsAuthentication.SignOut();
Request.Cookies.Remove("adminCookies");
new Cookies().RemoveCookies("adminCookies");
Session.RemoveAll();
Response.Redirect("~/Login.aspx");
}
}
catch (Exception ee)
{
Response.Redirect("~/Login.aspx?error=" + ee.Message.ToString(),false);
}
}
No comments:
Post a Comment