"Remember Me" Functionality

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
 
G

Guest

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
 
R

Raterus

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
 
T

Tampa.NET Koder

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top