SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Oct 2004
    Location
    chennai
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    session variables lost while redirecting in linux

    Dear All,
    I have just started working in php,
    I have a problem in redirecting session variables which is lost and not able to retrieve the session variable in the redirected page.
    I am posting the code below., Could someone please help me to fix the problem. I am using php 4.3.9 and apache 2.0.52.
    Thanks in advance.

    CallHeader.php
    <?php
    global $clientMachine ;
    $clientMachine = "appadurai" ;
    session_register(clientMachine);
    header("location:CheckGlobal.sgp");
    ?>

    CheckGlobal.php
    <?php
    session_start();
    echo "MACHINENAME $clientMachine";
    ?>

  2. #2
    SitePoint Addict sinapra's Avatar
    Join Date
    Sep 2004
    Location
    secunderabad
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    should it be session_register($clientMachine);?
    Regards

    Its Great to work and Be Merry!!!!!!!!

  3. #3
    SitePoint Member
    Join Date
    Oct 2004
    Location
    chennai
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the reply,
    I tried that but it did not work. I made a mistake in the thread posted, my actual session_register call looks like below.
    session_register("clientMachine")

    The same code works on another linux machine with different php and apache versions.

  4. #4
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:

    PHP Code:
    CheckGlobal.php
    <?php
    session_start
    ();
    echo 
    "MACHINENAME" $_SESSION['clientMachine'];
    ?>

  5. #5
    SitePoint Member
    Join Date
    Oct 2004
    Location
    chennai
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works great , thanks alot for the reply.
    I hope you can help me with more complex things to come

  6. #6
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    np - glad you got it working


Bookmarks

Posting Permissions

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