www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > PHP

    PHP Discussion and technical support for using and deploying PHP based websites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 06-01-2007, 12:03 PM
    L3zL1E L3zL1E is offline
    Registered User
     
    Join Date: Feb 2007
    Posts: 19
    php.ini / session variables

    I am working with session variables and can't seem to get them to work.

    My code is as follows:
    <?php
    session_start();
    ?>

    <html>
    <body>

    <?php
    $_SESSION['persist']="hello world";
    echo $_SESSION['persist'];
    print_r($_SESSION);
    ?>

    <a href="page2.php">Page 2</a>
    </body>
    </html>


    which links to page2

    <?php
    session_start();
    ?>

    <html>
    <body>

    <?php
    $x= $_SESSION['persist'];
    echo $x;
    ?>

    <a href="page2.php">End</a>
    </body>
    </html>


    but page two does not have hello world.


    I changed the ini file
    upload_tmp_dir="C:\PHP\upload"
    session.save_path="C:\PHP\Sessions"

    as well as all of the other places where session.save.path is.

    and created the new directories and the sess vars still will not work! I checked the directories and it is not making session files with the session ID information either!

    Any help is much appreciated!

    K
    Reply With Quote
      #2  
    Old 06-01-2007, 12:29 PM
    lth lth is offline
    忠孝礼&
     
    Join Date: May 2007
    Posts: 4
    Is there any error message ?
    That will be helpful.
    Reply With Quote
      #3  
    Old 06-01-2007, 01:25 PM
    L3zL1E L3zL1E is offline
    Registered User
     
    Join Date: Feb 2007
    Posts: 19
    no error message...just doesn't show session var
    Reply With Quote
      #4  
    Old 06-01-2007, 03:12 PM
    bokeh's Avatar
    bokeh bokeh is offline
    Keep it simple, stupid!
     
    Join Date: Jan 2005
    Location: Alicante (Spain)
    Posts: 7,708
    Run phpinfo() and check the local session save path is correct. Also check your browser doesn't have cookies disabled.
    Reply With Quote
      #5  
    Old 06-01-2007, 03:32 PM
    L3zL1E L3zL1E is offline
    Registered User
     
    Join Date: Feb 2007
    Posts: 19
    ran phpinfo, file path correct, cookies enabled.
    Reply With Quote
      #6  
    Old 06-01-2007, 03:35 PM
    L3zL1E L3zL1E is offline
    Registered User
     
    Join Date: Feb 2007
    Posts: 19
    does it matter where you put the directory for the session files? I put one in my php directory.

    I'm using IIS...asp session variables work, but php doesn't. I checked the weblogs and IIS is creating a phpsessid but the files aren't showing up. Could IIS be the problem anyways?
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 10:41 AM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.