Forum Moderators: open

Message Too Old, No Replies

Remember me cookie

Cant seem to get it to work

         

Blelisa

5:38 pm on Jun 21, 2005 (gmt 0)

10+ Year Member



Hello all,
I am trying to simply make a remember me cookie on my login.asp page so that when my visitors come back to my page they do not have to log in again. I can not seem to get it to work. I am not getting any errors but when I login than leave the site or close the browser than go back, I am expecting to see my username and password already filled out and it is not there. Below is my code, does anyone see what I may be missing? Thank you in advance.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
If request.form("remember") = "ON" Then
' Set cookie(s) to expire at later date, for example
response.cookies("username") = value
response.cookies("username").Expires = (Date+365)
End If
%>
<html>
<head>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="description" content...............................................................................................................<p class="main2"><form method="post" action="verify.asp" name="hemilog">
<p align="center" class="main2">Username:
<input type="text" name="username" size="30" value=""<%=Request.Cookies("username")%>>
<br /><br />
Password:
<input type="password" name="pwrd" size="30" value=""<%=Request.Cookies("username")%>>
<br /><br />
<input type="checkbox" name="remember" value="ON" checked> remember me<br />
<input type="submit" name="cmdsubmit" value="Log-In">
</p>
</form></p>................................................</html>

mercnboy3

6:10 pm on Jun 21, 2005 (gmt 0)

10+ Year Member



Should it be Request.Cookie and Response.Cookie instead of Request.Cookies and Response.Cookies?

Blelisa

7:08 pm on Jun 21, 2005 (gmt 0)

10+ Year Member



Double checked and according to tutorials should be cookies(pl). I also tried to make it singular but got error.

mercnboy3

8:04 pm on Jun 21, 2005 (gmt 0)

10+ Year Member



Try this format of Expires=#July 10,2005#

Blelisa

1:47 pm on Jun 22, 2005 (gmt 0)

10+ Year Member



No, that didn't work either