Keep having to log in

From: Matt 4 Jun 2013 18:25
To: Kenny J (WINGNUTKJ) 13 of 17
You should be able to use the developer tools in IE to delete the cookies just for tehforum.co.uk.
From: Kenny J (WINGNUTKJ) 4 Jun 2013 19:55
To: Matt 14 of 17
Yeah, that didn't seem to want to happen - they weren't being deleted no matter how hard I pushed the button. I've now exported all cookies to a text file, edited out the forum ones, cleared IE's cookies fully, and re-imported the text file, and everything seems to be working. Does the multiple-sets-of-cookies-causing-repeated-logging-in theory sound plausible?
From: Matt 4 Jun 2013 21:08
To: Kenny J (WINGNUTKJ) 15 of 17
Yes.

The HTTP specification allows for cookies with the same name, but different paths. Unfortunately as far as I know PHP doesn't account for this, instead all it does is add all the cookies to a simple single-dimension key-value-pair array (named $_COOKIES) and makes them all available to the script regardless of whether the path matches or not.

And because it's perfectly possible for the browser to format the cookie header so as to send the valid cookie before the invalid one, when PHP processes the header, it simply overwrites any existing entry in the array resulting in the valid cookie never being available to the script.

Which is a bit shit.
EDITED: 4 Jun 2013 21:09 by MATT
From: Kenny J (WINGNUTKJ) 4 Jun 2013 22:23
To: Matt 16 of 17
Thanks for the explanation!  (Although it's reminded me of just how much I've forgotten about this kind of thing. I'm sure I used to be able to do websites...)
From: JonCooper 9 Jun 2013 20:28
To: ALL17 of 17
FWIW - I didn't fix my chrome since it wasn't happening anywhere else, it isn't happening here any more - odd