Unable to access session values/variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raji20
    New Member
    • Aug 2006
    • 28

    Unable to access session values/variables

    This is my first page named test.php, In this page iam assigning the value to the session variable username,and I could able to access that value in this page.

    But when I access the same session variable in the next page named test1.php, the value of the session seems to be empty.

    Iam using PHP Version 4.3.10


    test.php,
    <?php
    session_start() ;
    $_SESSION["username"]="testing";
    echo $_SESSION["username"]."**";
    ?>
    <html>
    <head>
    </head>
    <body>

    <form name="frm1" action="test1.p hp" method="post">
    <input type="Hidden" name="name" value="testing" >
    <input type="Submit" name="s1" value="submit">
    </form>
    </body>
    </html>

    test1.php

    <?php
    session_start() ;
    echo "sess=".$_SESSI ON["username"];
    ?>
  • vcvc
    New Member
    • Sep 2006
    • 2

    #2
    Hello Raja~

    Your code have not any problem~ maybe your php.ini config problem !

    Comment

    • raji20
      New Member
      • Aug 2006
      • 28

      #3
      can you tell what will be the problem in the php.ini.

      that will be very gratefull

      Comment

      Working...