By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,812 Members | 1,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,812 IT Pros & Developers. It's quick & easy.

Session data lost in Firefox

P: n/a
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
gone.

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!

Cheers,
Jeremy.
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Jeremy Epstein wrote:
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


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

HTH

C.
Jul 17 '05 #2

P: n/a
Colin McKinnon wrote:
Cookie policy in Firefox? Clear all your cookies, start a session, check for
cookies.


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
difference.

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?

Jeremy
Jul 17 '05 #3

P: n/a
*** Jeremy Epstein wrote/escribió (Mon, 23 May 2005 14:09:22 +1000):
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?


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

I mean: if you set a cookie for www.example.com it won't be sent to
example.com and viceversa.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.