473,322 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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

Hello,

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:

foo.bar.net?script.php

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

bar.net?login.php

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 bar.net
instead of $_COOKIE['username'] from foo.bar.net.

Hey, mozilla, if I'm navigating at foo.bar.net, please
use the cookie from foo.bar.net when automatically
filling out my forms, or follow what my correct
html says, but don't use $_COOKIE['username']
from bar.net 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 foo.bar.net, 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 bar.net 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,

Thanks,

Neil
Jul 17 '05 #1
0 1655

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: M.D. | last post by:
Hi, I am having a problem with my program which only happens when using Mozilla or Firefox. The pages I wrote, are part of a private web directory, a service offered by the ISP, which upon...
1
by: Rob | last post by:
Hi, I'm using ASP to create a persistent cookie. The following code is used... CODE_STARTS .... 'and set up our cookie... Response.Cookies("login_authorised")("username") = username...
3
by: rss | last post by:
SUMMARY: ========== I am unable to pass along a simple Cookie obtained from a HttpWebRequest call (Machine A's ASP.NET app) so that another Web Server (Machine B) recongnizes the cookie. I...
3
by: Wysiwyg | last post by:
After a server created cookie is processed on the client I want it removed, cleared, or expired in the javascript block but have been unable to do this. If I set a cookie value in the server code...
7
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
29
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a...
1
by: jazzdrums | last post by:
Hello, we have migrated our website from .NET 1.1 to .NET 2.0. After this, some of our users are unable to log-on our site, while for the majority of them there's no problem. We're using a...
2
by: Gary Hasler | last post by:
I am having various problems with web pages on our site not displaying the result of form submissions properly for users with Mozilla type browsers (eg Firefox, Netscape). After investigation I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.