how to solve logout problem

Posted by Skaftabali under ASP.NET on 10/30/2010 | Points: 10 | Views : 1624 | Status : [Member] | Replies : 1
Hi

When I login to my web project and made some transactions.
again when i run application without logout.At that time
loginpage is coming and that user not logout.how to solve this one pls gide me.
my logout code is
logout_click()

FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();
Session.Abandon();
Response.Redirect("loginpage");




Responses

Posted by: Poster on: 10/30/2010 [Member] Starter | Points: 25

Up
0
Down
So in this case you want the behavior that if the logged in person has closed the app and opening the application again then that user should be logged in as he had not logged out while closing the application.

In this case you will have to use persistence cookie to create the login feature. Read this article http://www.dotnetfunda.com/articles/article114.aspx for complete details. In specific, if you are using FormsAuthentication to login, you need to pass third parameter as true

FormsAuthentication.RedirectFromLoginPage(Login1.UserName, true);


Above is the code for this.

Thanks

Skaftabali, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response