Page 1 of 1

Cant get sessions to work

Posted: Sat Jan 25, 2003 2:13 am
by nigma
When I try to start a session I get a message similar to this:

WARNING: session_start() [fuction.session-start]: open(/tmp\sess_25ff1bdc524011e280e625845ed204b9, O_RDWR) failed: No such file or directory (2) in C:/dir/to/script/that/uses/a/session.

Any one know what is going on and how to correct this problem?

Thanks for all help provided.

Posted: Sat Jan 25, 2003 2:17 am
by volka
set session.save_path in your php.ini to a valid path ( directory that exists and php can read/write)


http://www.php.net/manual/en/ref.session.php

Posted: Sat Jan 25, 2003 3:06 am
by nigma
Thanks a bunch. I am checkin it out right now.

Posted: Sat Jan 25, 2003 3:15 am
by nigma
Okay. I tried doing that, it didn't work. But I dont think I did it right here is what I did:

Changed this line: ; session.save_path = "N;\path"
To this: ; session.save_path = "N;C:\path\to\session\save"

Is that right?

Also you have any suggestions on paths that would be bad for secuirity?

Posted: Sat Jan 25, 2003 4:06 am
by volka
N;?
just the path, e.g. mine is session.save_path = E:/webserver/sessions
Also you have any suggestions on paths that would be bad for secuirity?
hmmm...only thought that comes to my mind right now is: do not place it within your web-tree ;)

Posted: Sat Jan 25, 2003 12:56 pm
by nigma
okay. So if my index.php file was in lets say C:\webserver\site\index.php

I wouldn't want to place it anywhere inside C:\webserver\site\.....

Is that about right?

Posted: Sat Jan 25, 2003 1:12 pm
by nigma
Here is my session save path line:
session.save_path = C:\Program Files\Apache2\sessions\

I tried this I still get the same message. Then I tried creating the dir sessions, still no use. You know what I need to do?

Posted: Sat Jan 25, 2003 2:51 pm
by twigletmac
What is listed as the session save path when you run a file containing:

Code: Select all

<?php
phpinfo();
?>
Mac

Posted: Sat Jan 25, 2003 3:22 pm
by nigma
session.save_path reads: C:/Program Files/Apache2/sessions

Posted: Sat Jan 25, 2003 5:46 pm
by nigma
I just thought of something; I got more than one error message when creating the session and maybe one of the other errors triggered the a problem with the session. If this is so then here are all the errors I recieved:

Warning: session_start() [function.session-start]: open(C:/Program Files/Apache2/sessions\sess_a283ff3c79b9eb7d9dd0bb5226386d11, O_RDWR) failed: No such file or directory (2) in C:\Program Files\Apache Group\Apache2\mc0\validate.php on line 7

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\mc0\validate.php:6) in C:\Program Files\Apache Group\Apache2\mc0\validate.php on line 7

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\Apache Group\Apache2\mc0\validate.php:6) in C:\Program Files\Apache Group\Apache2\mc0\validate.php on line 7
validated
Warning: Unknown(): open(C:/Program Files/Apache2/sessions\sess_a283ff3c79b9eb7d9dd0bb5226386d11, 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 (C:/Program Files/Apache2/sessions) in Unknown on line 0

Posted: Sun Jan 26, 2003 12:21 am
by volka
has the account apache is running under permissions to read/write that directory (C:/Program Files/Apache2/sessions) ?
Test this by setting permissions to full access to anyone

Posted: Sun Jan 26, 2003 11:04 am
by nigma
Right now apache is running under windows( I cant get linux to talk to the wireless USB card so no internet for linux). So I would think it does have permissions. Do I have to change something in one of the config files in order to give it full permissions?

Posted: Sun Jan 26, 2003 12:03 pm
by volka
which version of windows?

Posted: Sun Jan 26, 2003 12:24 pm
by nigma
XP Pro

Try using "C:\WINDOWS\Temp".

Posted: Mon Feb 03, 2003 10:53 pm
by Brian
Try using "C:\WINDOWS\Temp".