PHP and Mozilla: Mozilla bug? cookie problem and how I solved it

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I just ran into an interesting problem with cookies while
using PHP 4 and Mozilla 1.6. Basically, I have been using
PHP on a site called:

Within that script I call setcookie() and manipulate
cookie variable $_COOKIE['username']. All works fine
as far as what is produced in the HTML output.

However, it so happens that when I logged into the
provider's web page, which happens to be called

the provider stores a cookie called $_COOKIE['username'].

So then mozilla uses the wrong cookie indexed under
Mozilla -> Edit -> Preferences -> Privacy & Security -> Cookies
-> Manage Stored Cookies

It ends up using $_COOKIE['username'] from site
instead of $_COOKIE['username'] from

Hey, mozilla, if I'm navigating at, please
use the cookie from when automatically
filling out my forms, or follow what my correct
html says, but don't use $_COOKIE['username']
from cause that's my provider's cookie,
not mine, and it's a different one.

People, am I right or am I wrong? Is this a bug in
mozilla? Seems like a bug in mozilla, or, a bug in
PHP, but it really seems like a bug in mozilla since
my PHP output is correct (and uses the value of
$_COOKIE['username'] from, however
when mozilla fills in the form values, it does
not use what I say in the value attribute of
my input element. Instead, it fills out the
cookie value for that it stored.

This seems clearly wrong to me. Ideas?
I checked Form Manager in Mozilla, but
saw no such cookie named username there.

So the solution was to prepend foo_ to all my
COOKIES and hope my provider doesn't use them.

Feedback much appreciated,



Site Timeline