Results 1 to 2 of 2

Thread: PHP session issue

  1. #1
    Join Date
    Oct 2008
    Posts
    6

    Exclamation PHP session issue

    Hi there,

    Hoping someone can shed some light on this for me.

    Am working on an app on my own machine using php 5.2.6 with an IIS server and MySQL back end.

    The big issue is the sessions. They were working fine until yesterday and all of a sudden, nothing! Was adding an Import/Export function to the admin section of the app when I noticed they werent working, though I didnt touch on the $_SESSION array at all for the new admin functions.

    Have tested using the following code:

    1.php
    PHP Code:
    <?php
    session_start
    ();
    $_SESSION['test'] = "hi";
    echo 
    "Session ID: ".session_id()."<br />";
    echo 
    "<a href=2.php>page 2</a>";
    ?>
    2.php
    PHP Code:
    <?php
    session_start
    ();
    echo 
    "TESTER: ".$_SESSION['test']."<br />";
    echo 
    "Session ID: ".session_id()."<br />";
    echo 
    "<a href=1.php>page 1</a>";
    ?>
    As you can see, possibly the simplest session test ever created, outputs the session id so I can visually verify it and also passes one session argument and outputs for verification.

    Unfortunately, although the session ids are both the same, nothing seems to be getting passed! $_SESSION['test'] doesnt output anything.

    Havent touched anything to do with sessions, just wont do anything with them now, anyone see anything claringly obvious with this simple example - because I sure cant

    Anyway, anything that helps shed light on this situation will be greatly appreciated!

    Cheers

  2. #2
    Join Date
    Feb 2009
    Location
    Canada eh!
    Posts
    41
    I don't see any problems in the code, must be environmental. Did you try a different browser? Does phpInfo() show anything strange in the session area?

    -Erik

Similar Threads

  1. php session handling
    By phouse in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 07 Nov 2005, 09:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •