[clug-progsig] Cookie monster eating my cookies?
sgrover at open2space.com
Wed Oct 11 12:14:02 PDT 2006
> I have a cookie that I am setting with:
> setcookie('pseudo_sess', md5($rand), time() + PSEUDO_SESSION_LENGTH, '/');
> and it works great on my local machine on all browsers, but not on the live
> server. The behaviour is very odd, it does work in FF but not IE, Opera or
> Konq. I turned on the option to ask about cookies in Opera and it's like the
> cookie isn't being sent, but I know it is b/c it works in FF.
> My other thought was the cookie being rejected for security reasons but even
> with everything at the lowest settings, accept all cookies on etc etc it
> won't work.
> I've also tried setting the cookie specifically to the domain it's on,
> Any ideas?
Prove to yourself the cookies are being sent. As Mark mentioned, you
could use Wireshark... But an easier way might be to use telnet.
telnet yourserver 80
That will establish a connection to the server on port 80 - chances are
you'll be presented with a blank screen, or no cursor. Type in this:
(change the path to reflect your page....)
Then hit the enter key twice. (blank line sends request)
(note in Windows, you probably won't see the text you type - local echo
This will result in the page being sent to you, with all the HTTP
headers that go along with it. Including the cookies. It'll be dumped
as plain text in the telnet session.
If you see your cookies, then you have a browser issue. If you don't
then you have a server issue.
(hmmm.. I just tried to prove this with one of my sites, and I don't see
any cookie code there... A second site (which is password protected) is
more promising, but still don't see the headers... hmmm... this could
still be useful though, so I'll leave my comments as is)
More information about the clug-progsig