Question about Sessions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
latoyale
Forum Commoner
Posts: 25
Joined: Fri Apr 04, 2008 1:16 am

Question about Sessions

Post by latoyale »

My code is producing the following the errors:

Warning: session_start(): open(html/askslicky/inner/sessions/sess_ae6803a8d0a32eb491bcddd19881d656, O_RDWR) failed: No such file or directory (2) in /home/content/j/a/b/jaberkjaber/html/askslicky/inner/signup.php on line 3

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/j/a/b/jaberkjaber/html/askslicky/inner/signup.php:3) in /home/content/j/a/b/jaberkjaber/html/askslicky/inner/signup.php on line 3

At the top of my form I have:
<?php
session_save_path("html/askslicky/inner/sessions");
session_start();

I'm thinking that the code "sessions_save_path" is supposed to save my sessions temporary in a folder that I set up on the server called "sessions." Is this correct?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Question about Sessions

Post by Christopher »

The first error is because "html/askslicky/inner/sessions" does not exist. The second is because the error messages are sending output before the session_start(). You should use an absolute path rather than a relative one for session_save_path(). You may want to do the following to see what the path is currently set to:

Code: Select all

echo session_save_path();
(#10850)
Post Reply