in reply to Cookies Not Getting Set First Time
My logic is thus: setting a cookie is just including a header line with the desired contents of the cookie to the client. However, since the clients' cookies are sent upon request of a page (and before the http header returned by the server), it wouldn't be available upon the first execution of the script. That would explain why you have to try twice before successfully fetching it - once to set the cookie, and once again to retrieve it.
If this is truly the problem, there's really no recourse to having to call the thing twice, whether it's with the cookie-setting and the cookie-fetching being in the same script or different scripts. Or if you can find a way to travel faster than light you can bypass the causality constraints.
If you manage to do the latter with Perl, make sure you post it to CUFP...
|
|---|