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.
Just give the href value of logout page. href="Logout. aspx" .
You can place a Loguot Button/Menu so that user will click for logout. Now when logout button pressed Just clear all Variables value which you used for storing the session, and then hide this form and navigate to the login form again.......
use FormsAuthentication.SignOut();
as below:
protected void LogoutButton_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("~/Login.aspx");
}
None worked for me but this does.
Context.GetOwinContext().Authentication.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
Use Session.Clear()
like this:
protected void Button_Click(object sender, EventArgs e)
{
Session.Clear();
Response.Redirect("Login.aspx");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With