I need to add a "remember me" check to a Classic ASP web login form.
How I can keep users logged for weeks or months, despite the Application Pool recycling, and when users restart your browser?
The site is on a server with iis8.
Thanks.
I need to add a "remember me" check to a Classic ASP web login form.
How I can keep users logged for weeks or months, despite the Application Pool recycling, and when users restart your browser?
The site is on a server with iis8.
Thanks.
response.cookies("ID_User")=session("ID_User")
response.cookies("ID_User").expires=date()+90
response.cookies("ID_User").path="/"
response.cookies("yn_AutoSign") = yn_AutoSign 'this might equal "yes" or "no"
response.cookies("yn_AutoSign").expires=date()+90
response.cookies("yn_AutoSign").path="/"
Oh and if you want the full sign-in that I've built for my CMS, I'm happy to give you the ASP files to do it. I went ahead and zipped em up and put them in a place you can get them from: http://www.oceanmedia.net/files/HK-sign-in.zip
If your 'remember me' check box is checked you can set a cookie.
<%
Response.Cookies("loggedin") = 1
Response.Cookies("loggedin").Expires = Date() + #OfDays
%>
Then to check if it the user is already logged in...
<%
loggedin = Request.Cookies("loggedin")
if loggedin = 1 then
response.write ("User logged in already.")
else
response.write ("User is not logged in.")
end if
%>
I found these information that solved my doubts:
What is the best way to implement "remember me" for a website?
The definitive guide to form-based website authentication
Finally, I'll opt for doing what it says on this website: http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/