Click here to Skip to main content
15,886,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I login to my web project and make some transactions.
When I run application again without logging out the login page is coming up again even though the user is not logged out.

How to solve this one?
Please guide me.

my logout code is
logout_click()

FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();
Session.Abandon();
Response.Redirect("loginpage");
Posted
Updated 31-Oct-10 4:05am
v3
Comments
Sandesh M Patil 30-Oct-10 4:05am    
you are accessing it in different browser?
skaftabali 30-Oct-10 7:11am    
yes same browser and also other browser
Dalek Dave 31-Oct-10 10:05am    
Edited for Grammar, Syntax and Readability.

1 solution

When a browser window is closed, the authentication ticket is lost. You need to create a persistent cookie for this.

Don't know the way you are using authentication.
If you're using the typical
'FormsAuthentication.RedirectFromLoginPage()' function, set the
second param(create persistent cookie to true) Eg:
FormsAuthentication.RedirectFromLoginPage("userName",true)

That'll create a persistent cookie and will work with browser restarts.
(not for different browsers). Hope you know about the cookie expiration time
 
Share this answer
 
Comments
Dalek Dave 31-Oct-10 10:05am    
Good call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900