Session data lost in Firefox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeremy Epstein

    Session data lost in Firefox

    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_registe r(). I'm calling session_start() at the start of each
    page. In my php.ini, I have session.use_onl y_cookies on, and
    session.use_tra ns_sid off.

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

    Cheers,
    Jeremy.
  • Colin McKinnon

    #2
    Re: Session data lost in Firefox

    Jeremy Epstein wrote:
    [color=blue]
    > 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
    >[/color]

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

    HTH

    C.

    Comment

    • Jeremy Epstein

      #3
      Re: Session data lost in Firefox

      Colin McKinnon wrote:
      [color=blue]
      > Cookie policy in Firefox? Clear all your cookies, start a session, check for
      > cookies.[/color]

      The problem gets weirder and weirder...

      I've set the session.save_pa th 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

      Comment

      • Alvaro G Vicario

        #4
        Re: Session data lost in Firefox

        *** Jeremy Epstein wrote/escribió (Mon, 23 May 2005 14:09:22 +1000):[color=blue]
        > 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?[/color]

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

        Comment

        Working...