problem with session_start()

This is a discussion on problem with session_start() within the PHP Language forums, part of the PHP Programming Forums category; when I use the session_start() function at the top of my scripts I get 5 errors on the page If ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2005
cowofchaos@gmail.com
 
Posts: n/a
Default 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(\sessiondata\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(\sessiondata\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_path is correct (\sessiondata)
in Unknown on line 0

Reply With Quote
  #2 (permalink)  
Old 04-16-2005
cowofchaos@gmail.com
 
Posts: n/a
Default Re: problem with session_start()

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

Reply With Quote
  #3 (permalink)  
Old 04-16-2005
Andy Hassall
 
Posts: n/a
Default Re: problem with session_start()

On 16 Apr 2005 08:16:15 -0700, "cowofchaos@gmail.com" <cowofchaos@gmail.com>
wrote:

>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_path is correct (\sessiondata)
>in Unknown on line 0


That's the key - your session.save_path 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.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
  #4 (permalink)  
Old 04-16-2005
cowofchaos@gmail.com
 
Posts: n/a
Default Re: problem with session_start()

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

Reply With Quote
  #5 (permalink)  
Old 04-16-2005
Andy Hassall
 
Posts: n/a
Default Re: problem with session_start()

On 16 Apr 2005 08:23:38 -0700, "cowofchaos@gmail.com" <cowofchaos@gmail.com>
wrote:

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


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.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
  #6 (permalink)  
Old 04-16-2005
cowofchaos@gmail.com
 
Posts: n/a
Default Re: problem with session_start()

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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:14 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0