Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    session variables

    i used this function:
    session_start();
    and i had these warnings:
    Warning: Cannot send session cache limiter - headers already sent (output started at c:\program files\apache group\apache\htdocs\test\index.php:8) in c:\program files\apache group\apache\htdocs\test\index.php on line 38

    Warning: open(/tmp\sess_2f20ae55ca19e33486cb9c946e0b2c97, O_RDWR) failed: m (2) in c:\program files\apache group\apache\htdocs\test\index.php on line 38

    Warning: open(/tmp\sess_2f20ae55ca19e33486cb9c946e0b2c97, O_RDWR) failed: m (2) in Unknown on line 0

    Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

    what is the problem? and what is the solution?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    You cannot output anything at all to the browser before calling the session_start() function. So make sure you have don't have any extra lines or spaces that are being outputted to the browser before that line.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,093
    Thanks
    11
    Thanked 101 Times in 99 Posts
    you need to edit your php.ini to set the session.save_path directive to a directory that exists , say 'c:/windows/temp' or whatever , just make sure it exists
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #4
    New Coder
    Join Date
    Apr 2004
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Best advice: If your using php sessions on a page, the VERY FIRST TWO LINES should look like this:

    PHP Code:
    <?
        session_start
    ();
        
    // Rest of code

  • #5
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by zigo86
    Best advice: If your using php sessions on a page, the VERY FIRST TWO LINES should look like this:

    PHP Code:
    <?
        session_start
    ();
        
    // Rest of code
    No. Your very first line should be
    PHP Code:
    <?php
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #6
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,093
    Thanks
    11
    Thanked 101 Times in 99 Posts
    the output errors are probably due to the warnings created from the session write error , fix the session.save_path first , the other errors may then (or may not) go away.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #7
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Quote Originally Posted by firepages
    you need to edit your php.ini to set the session.save_path directive to a directory that exists , say 'c:/windows/temp' or whatever , just make sure it exists
    Wow how did I miss those other warnings they had posted? lol That's what I get for trying to answer a question at 6:30 in the morning.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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