Php Session Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepsfriend4u
    New Member
    • Jan 2008
    • 2

    #1

    Php Session Problem

    Hello,

    i have one application in that i use session .
    problem is,
    same code and session data use work successful in Firefox but not work in Internet Explore.

    Thanks & Regards
    Deepak
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    That's a shame.

    Post the code you're using..

    Comment

    • deepsfriend4u
      New Member
      • Jan 2008
      • 2

      #3
      Originally posted by markusn00b
      That's a shame.

      Post the code you're using..
      //After login on home page
      <?php
      session_start() ;
      session_registe r('id');
      $_SESSION['id']=$userid; //user id after successful login
      .

      .
      // bla bla bla
      .


      ?>

      //when i try to move to following page

      <?php

      session_start() ;
      print_r($_SESSI ON); //some debugging info
      die();
      ?>

      the session array dont show the userid added

      ------------------------------------------------------------------------------------

      After browsing the pages the session data shows correct in Firefox but empty session in IE.

      Comment

      • adamalton
        New Member
        • Feb 2007
        • 93

        #4
        It's a bit hard to tell where it's going wrong without being able to play around with it. But try printing out the cookies that IE has sent to the page, if IE has not sent the PHPSESSID cookie back to you then you know... well you know that it's not sending the cookie back!!
        [PHP]print $_COOKIE['PHPSESSID'];
        //OR
        print_r($_COOKI E);[/PHP]

        If that does turn out to be the problem, then I would suggest installing Live HTTP Headers for FireFox. I know the problem is in IE, but being able to see the headers that are being sent is MASSIVELY useful when dealing with problems like this. You can see the HTTP header that sets the cookie, and you can see the headers that the browser sends back to PHP.

        Hope that helps

        Comment

        Working...