'how to really logout in asp.net

I use LoginControl for login into my website in asp.net, but when for logout use login status or session.Abandon or .sign out ,there's white backspace, my homepage is loaded and its not secure.

Please help me that use realy logout in my project.



Solution 1:[1]

use FormsAuthentication.SignOut(); as below:

protected void LogoutButton_Click(object sender, EventArgs e)
{
    FormsAuthentication.SignOut();
    Response.Redirect("~/Login.aspx");
}

Solution 2:[2]

None worked for me but this does.

Context.GetOwinContext().Authentication.SignOut(DefaultAuthenticationTypes.ApplicationCookie);

Solution 3:[3]

Use Session.Clear() like this:

protected void Button_Click(object sender, EventArgs e)
{
    Session.Clear();
    Response.Redirect("Login.aspx");
}

Solution 4:[4]

The home webpage is loading from the browser cache, use the below metadata tags to force the browser to clear cache after exiting the page

<head runat="server">
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="cache-control" content="no-store" />
<meta http-equiv="cache-control" content="must-revalidate" />
<meta http-equiv="cache-control" content="proxy-revalidate" />

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Habibillah
Solution 2 Crismogram
Solution 3 SharpC
Solution 4 Hassan Mokdad