"Remember Me" Functionality

  • Thread starter Thread starter TCORDON
  • Start date Start date
T

TCORDON

Can someone give me a sample or point me in the direction of one, on how to
implement User "Remember Me" option when logging into a website?

TIA
 
The best method is to place a cookie on the user's computer and detect it on
later visits. If the cookie exists, then log the user in. You can check the
cookie in either JavaScript or ASP.NET. Do a search on ASP.NET Cookies or
JavaScript Cookies for a ton of examples.

Ian Suttle
http://www.IanSuttle.com
 
If you use Forms Authentication, one of the options you can set when logging a user in is to create a persistant cookie.

FormsAuthentication.SetAuthCookie("joeuser", True) <-- would create a persistant cookie
FormsAuthentication.SetAuthCookie("joeuser", False) <-- would not create a persistant cookie
 
If you are using a checkbox, you can do this:

FormsAuthentication.SetAuthCookie("joeuser", CheckBox1.Checked) <-- would
create a persistant cookie
FormsAuthentication.SetAuthCookie("joeuser", CheckBox1.Checked) <-- would
not create a persistant cookie

OR

You can use

FormsAuthentication.RedirectFromLoginPage("username", CheckBox1.Checked)


So, the Checkbox1.Checked returns a Boolean value

http://msdn.microsoft.com/library/d...nticationclassredirectfromloginpagetopic1.asp





If you use Forms Authentication, one of the options you can set when logging
a user in is to create a persistant cookie.

FormsAuthentication.SetAuthCookie("joeuser", True) <-- would create a
persistant cookie
FormsAuthentication.SetAuthCookie("joeuser", False) <-- would not create a
persistant cookie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top