Session data lost in Firefox

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

Threaded View

I've got a 4-page form that lets users enter a whole lot of information,
which is then submitted and emailed at the end. All the fields are
stored as session data.

The whole thing works fine:

1. On my local box (WinXP / Apache2 / PHP4) using IE6
2. On my local box using Firefox1
3. On my hosted server (RHLinux / Apache1.3 / PHP4) using IE6

But when I try it:

4. On my hosted server using Firefox1

Then every time I continue to the next page of the form, all session
data is lost, except for the fields that were just submitted on the
previous page.

So say, for example, you're on page 4 of the form. Everything submitted
on page 3 is stored as session data, but the stuff from pages 1 and 2 is

I'm storing the session data using cookies - I think this is where the
problem may be. Is Firefox somehow losing the cookie everytime it goes
to a new page?

I'm using the $_SESSION[] variable directly, not ever using
session_register(). I'm calling session_start() at the start of each
page. In my php.ini, I have session.use_only_cookies on, and
session.use_trans_sid off.

Any ideas? This is really frustrating me - I'm tearing my hair out
trying to get it to work!


Re: Session data lost in Firefox

Jeremy Epstein wrote:

Quoted text here. Click to load it

Cookie policy in Firefox? Clear all your cookies, start a session, check for



Re: Session data lost in Firefox

Colin McKinnon wrote:

Quoted text here. Click to load it

The problem gets weirder and weirder...

I've set the session.save_path in my php.ini to a special ~/sessions
directory. When I open a new session, the session info comes up in
Firefox's cookie list, and the session appears as a new file in my
~/sessions directory.

Each time that I hit 'continue' in IE, I check the file in the
~/sessions directory, and it has new data in it. However, each time that
I hit 'continue' in Firefox, the file is still blank! So Firefox is able
to initiate the session, on the client and the server side (just like
IE), but it's not able to save any data to it.

I also tried this in Opera 7, btw, and it works fine just like in IE.
Also tried it on Firefox using a different machine, with same results.
So it's not because of any particular problem with my Firefox install. I
added the site to my list of allowed cookie sites in Firefox - made no

This is all so weird - everything is being handled by PHP, and the
session data is getting saved to a file on the server - so shouldn't
this all be a server-side process that's totally browser independent? I
can't even work out why using a particular browser matters! Is Firefox
sending the post data wrong, or something?


Re: Session data lost in Firefox

*** Jeremy Epstein wrote/escribió (Mon, 23 May 2005 14:09:22 +1000):
Quoted text here. Click to load it

Do you access the hosted site using always the same domain name?

I mean: if you set a cookie for it won't be sent to and viceversa.

-- Álvaro G. Vicario - Burgos, Spain
-- - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group

Site Timeline