Home > DeveloperSection > Forums > How to create remember me checkbox to remember session until user Logout explicitly
john rob

Total Post:108

Points:756
Posted on    August-26-2014 2:06 AM

 VB.Net VB.Net 
Ratings:


 1 Reply(s)
 880  View(s)
Rate this:

If user directly close their browser without clicking logout then next time they open browser its session will be maintained as it is till they logout explicitly by clicking Logout button

I want to do it in vb.net !



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    August-26-2014 2:53 AM

Hi John, 

Simply pass true as second parameter when emitting the authentication cookie:

FormsAuthentication.RedirectFromLoginPage(Username, true)

This will create a persistent authentication cookie on the client whose expiration is handled by the timeout property in your web.config:

<forms

   loginUrl="~/login.aspx"

   defaultUrl="~/default.aspx"

   protection="All"

   timeout="3600"

</forms>


Don't want to miss updates? Please click the below button!

Follow MindStick