problem with session_start()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cowofchaos@gmail.com

    #1

    problem with session_start()

    when I use the session_start() function at the top of my scripts I get
    5 errors on the page
    If anyone can help please do this has been a problem for a while and I
    cannot do much more work on my site without fixing this and getting the
    login system to work

    Here are the errors:

    At the TOP of the page I get the following three errors,

    Warning: session_start() : open(\sessionda ta\sess_***, O_RDWR) failed:
    No such file or directory (2) in \header.php on line 2


    Warning: session_start() : Cannot send session cookie - headers already
    sent by (output started at \header.php:2) in \header.php on line 2

    Warning: session_start() : Cannot send session cache limiter - headers
    already sent (output started at \header.php:2) in \header.php on line 2

    At the BOTTOM of the page I get two other errors,

    Warning: Unknown(): open(\sessionda ta\sess_***, O_RDWR) failed: No such
    file or directory (2) in Unknown on line 0

    Warning: Unknown(): Failed to write session data (files). Please verify
    that the current setting of session.save_pa th is correct (\sessiondata)
    in Unknown on line 0

  • Andy Hassall

    #2
    Re: problem with session_start()

    On 16 Apr 2005 08:16:15 -0700, "cowofchaos@gma il.com" <cowofchaos@gma il.com>
    wrote:
    [color=blue]
    >when I use the session_start() function at the top of my scripts I get
    >5 errors on the page
    >If anyone can help please do this has been a problem for a while and I
    >cannot do much more work on my site without fixing this and getting the
    >login system to work
    >
    >Here are the errors:
    >
    >At the TOP of the page I get the following three errors,
    >
    >Warning: Unknown(): Failed to write session data (files). Please verify
    >that the current setting of session.save_pa th is correct (\sessiondata)
    >in Unknown on line 0[/color]

    That's the key - your session.save_pa th is wrong. All the errors stem from PHP
    not being able to write session data to where you've specified.

    What operating system are you on? If Unix-based, the slash is the wrong way
    around. If Windows-based you haven't got a drive letter so it might be looking
    on the wrong drive.

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • cowofchaos@gmail.com

      #3
      Re: problem with session_start()

      I know the last error says to check the seesion.save_pa th variable, I
      did and its set to the right spot so I'm not sure what the problem is

      Comment

      • cowofchaos@gmail.com

        #4
        Re: problem with session_start()

        I'm on windows XP and I've checked the path its C:\PHP\sessiond ata, I'm
        going to double check it and make sure the folder exists now..

        Comment

        • Andy Hassall

          #5
          Re: problem with session_start()

          On 16 Apr 2005 08:23:38 -0700, "cowofchaos@gma il.com" <cowofchaos@gma il.com>
          wrote:
          [color=blue]
          >I'm on windows XP and I've checked the path its C:\PHP\sessiond ata, I'm
          >going to double check it and make sure the folder exists now..[/color]

          That's not what PHP is seeing though; you might want to reverse the slashes to
          c:/PHP/sessiondata, or add some quotes around it, or double up the \'s -
          Window's use of \ for a directory separate clashes nastily with \ as an escape
          character - but all the Windows system calls will accept Unix-style '/' as a
          separator as well.

          --
          Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
          <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

          Comment

          • cowofchaos@gmail.com

            #6
            Re: problem with session_start()

            Ok, the problem was that my c:\php\sessiond ata folder just didn't
            exist... i created it and it seems to be working, thanks for your help!

            Comment

            Working...