On My Master page i have one Logout link button the below i was written on click event on masterpage.
protected void logout_Click(object sender, EventArgs e)
{
Session.Abandon();
Session.RemoveAll();
if (Session["mOrgCode"] == null)
{
Response.Write("<script>window.alert('Your Session has been expired,Please Login again.')</script>");
Response.Redirect("NewLogin.aspx");
}
}
and same way in the page load of loginpage,
page_Load
{
if(!IsPostback)
{
status = false;
if (status == false)
{
Session["DynamicCon"] = null;
Session["mOrgCode"] = null;
Session["mOrgName"] = null;
Session["mBusDate"] = null;
}
}
}