in reply to Cookie Problem

In addition to the excellent comments by dws above, I would only add that one other limitation of the Cookie mechanism of which you should be aware is that it is not possible to set and retrieve a Cookie within a single HTTP request - I only add this comment as it is not clear that you are aware of this from the code snippet provided.

In the article from merlyn to which a link has been provided, this issue was addressed by redirecting the client browser back upon the script, with the appropriate Set-Cookie header, if the required cookie did not already exist. The relevant section of code follows:

=25= param("_cookiecheck", 1); # prevent infinite loop =26= print redirect (-cookie => $cookie, -uri => self_url());

It may also be useful to read further about Cookies from the appropriate RFC document.

 

perl -e 'print+unpack("N",pack("B32","00000000000000000000000111011000")),"\n"'