Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Cookie Example Problem (p298) - Beg ASP 3.0


Message #1 by "William Hollister" <bholl33@h...> on Tue, 27 Mar 2001 17:08:20
Hi,
I apologize for wasting anyone's time, as I have a beginner problem... I 
am not a pro. Any help would be greatly appreciated.

I'm working through Beginning ASP 3.0 by Wrox. On page 295, a cookie 
example is shown. The exercise on seemed to work , but when I make the 
adjustments on page 298 in order to first "check" for cookies and
subsequently Redirect if the cookie "HasKeys", it won't redirect in my IE5 
browser. This makes me wonder if the cookie was set in the first place. I 
tried finding the cookie in the IE folders on the hard drive... and can't 
find it.

However, when I tried it in Netscape... low and behold, it worked. And I 
could find the cookie.

I am using PWS on Win98. The code for the login page is below.

Thanks for your time, Bill

<%
 If Request.Cookies("SavedLogin").HasKeys then
  Response.Redirect "CheckLogin.asp?cookie=1"
 End If
%>
<HTML>
<HEAD>
<TITLE>Cookie Test - Login</TITLE>
</HEAD>
<BODY>
Please enter your e-mail address and password to login to the system.
<FORM ACTION = "CheckLogin.asp"  METHOD="POST" >
E-Mail Address: <INPUT TYPE = "Text"  NAME = "Email"  SIZE = "40"><BR>
Password: <INPUT TYPE = "Password"  NAME = "Password"  SIZE = "10"><P>
<INPUT TYPE = "Checkbox"  NAME = "SaveLogin"> Save Login as a Cookie?<P>
<INPUT TYPE = "Submit"  VALUE = "Login">    
<INPUT TYPE = "RESET">
</FORM>
</BODY>
</HTML>

Thanks, Bill

  Return to Index