|
Hi, I am trying to do a very basic and simple password verifier using cookies. Mozilla keeps telling me that it can't perform the redirect commands and suggests
that a possible reason is that cookies have been disabled, but they haven't been disabled, so it's something else, but it still probably has to do with cookies. Here's the code, can anybody tell me what I might be doing wrong?
Here are the pages. Login.asp takes a username and password and then submits to passwordcheck.asp
<html>
<head>
<title>Logon Form</title>
</head>
<body bgcolor="#FFFFFF">
<center>
<FORM ACTION="passwordcheck.asp" method="post">
<table height="100%">
<tr>
<td align="center">
<h3>Login to Bowserlaw admin</h3>
<p>
Username:
<INPUT TYPE="text" NAME="User" VALUE='' size="20"></INPUT>
<br>
Password:
<INPUT TYPE="password" NAME="password" VALUE='' size="20"></INPUT><br>
<INPUT TYPE="submit" VALUE="Logon"></INPUT>
</FORM>
</center>
</body>
</html>
Here is what passwordcheck does with the submission
<%
if Request.Form("User") <> "frib" OR Request.Form("password") <> "frab" then
Response.Redirect "login.asp"
Else
'Set the validation cookie and redirect the user to the default admin page.
Response.Cookies("Bowserlaw") = "OK"
Response.Redirect "dwiadmin.asp"
End if
%>
Then, with each content page, I #include password.asp at the top, which checks for a set cookie before it does anything else.
<%
if Request.Cookies("Bowserlaw") <> "OK" then
Response.Redirect "login.asp"
End if
%>
Pretty simple right? So why doesn't it work? Thanks in advance.
Last edited by blip; 08-21-2006 at 09:11 AM..
|