p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Cookie, back button, and directories


Message #1 by jprentice@e... on Thu, 10 May 2001 16:21:55
I've already placed this on another forum, but since there's code 
involved, this forum may also apply...

I have a cookie on one of my sites that is created based on the secure 
login screen.  If you are Visitor type A, then no cookie is created; 
however, if  you are Visitor type B, the cookie is created.  Cookie use in 
question:  If the cookie exists, an image appears on the screen, otherwise 
it does not.  However if I were to go to a part of the site that is 
physically in a subdirectory, and then go back to the previous portion of 
the site (in the parent directory), the cookie is lost, or at least the 
image is.

My call:

<%If Request.Cookies("cookie") = "1" Then%> 

...show this clickable image...

<%else%>

...show this static image... 'this is what appears when image is lost

<%end if%>

My creation:

If nrs.Fields("booleanField") = TRUE Then
	Response.Cookies("cookie") = "1"
End If

In all other cases the cookie works flawlessly -- it's just the image 
problem.

Thanks for any suggestions.

  Return to Index