Fix Below My problem had nothing to do with headers having “already been sent”. That was simply a symptom of the problem. The problem ended up being a sever side issue with GoDaddy as a folder was missing on their end.
I have edited my question’s name to include “GoDaddy site” to maybe help someone in the future having the same issue.
Per @KennyPowers suggestion I called Go Daddy. I originally had a windows hosted account and switched to linux. Apparently the folder that session_start() saves to by default did not migrate with the rest of my site, and no you cant change the default folder..at least not on my site.
GoDaddy replaced the folder on their end and everything works fine now
Original Question:
I could use a little help using session_start()
Site flow:
- page1.html has a form which POSTs to page2.php
- page2.php does some stuff with the data and presents a link to
page3.php - when page3.php loads it also needs to do something with the data from
the form
All pages are on the same domain so Im trying to do this with session_start()
This is what Ive tried:
Page 2:
<?php
// page2.php
session_start();
echo 'Welcome to page #2';
$_SESSION["guest1Last"] = $_POST["guest1Last"];
$_SESSION["guest1First"] = $_POST["guest1First"];
$_SESSION["guest1Middle"] = $_POST ["guest1Middle"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Title</title>
// more HTML and PHP stuff down here
Page 3:
<?php
// page3.php
session_start();
echo 'Welcome to page #3<br />';
echo $_SESSION["guest1First"];
echo $_SESSION["guest1Middle"];
echo $_SESSION["guest1Last"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
// more HTML and PHP stuff down here
These are the warnings I get when page 2 loads:
(same thing on page3)
Warning: session_start() [function.session-start]: open(/var/chroot/home/content/08/10125908/tmp/sess_3dt4c7etqd6hr28dls0bludiv4, O_RDWR) failed: No such file or directory (2) in /home/content/08/10125908/html/_php/page2.php on line 4
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/08/10125908/html/_php/page2.php:4) in /home/content/08/10125908/html/_php/page2.php on line 4
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/08/10125908/html/_php/page2.php:4) in /home/content/08/10125908/html/_php/page2.php on line 4
Welcome to page #2
Warning: Unknown: open(/var/chroot/home/content/08/10125908/tmp/sess_3dt4c7etqd6hr28dls0bludiv4, 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 () in Unknown on line 0
The “headers already sent” part makes me think session_start() is not in the right place on the page but its at the top where I believe it should be. That said it seams likely that “No such file or directory” is where the problem is starting, for obvious reasons. I would greatly appreciate if someone could point me in the direction of what i am doing wrong.
EDIT
<?php
session_start();
ini_set('session.save_path', '/var/chroot/home/content/08/10125908/html/tmp');
echo 'Welcome to page #1';
$_SESSION["guest1Last"] = $_POST["guest1Last"];
$_SESSION["guest1First"] = $_POST["guest1First"];
$_SESSION["guest1Middle"] = $_POST ["guest1Middle"];
?>
- I created a folder tmp and gave it all permissions
- I added
ini_set('session.save_path',
'/var/chroot/home/content/08/10125908/html/tmp'); - and tried ini_set(‘session.save_path’, ‘html/tmp’);
- I also created a text file with
session_save_path('/home/content/04/8260904/html/tmp');saved it
as php.ini and uploaded it to my root - I also I also created a text file with
session_save_path('/home/content/04/8260904/html/tmp');saved it
as php5.ini and uploaded it to my root
Im still getting the same error
Warning: session_start() [function.session-start]: open(/var/chroot/home/content/08/10125908/tmp/sess_3659a32a50e33e5f918a9e39d70a1668, O_RDWR) failed: No such file or directory
am I not setting the folder destination correctly?
My folder setup now

Per @KennyPowers suggestion I called Go Daddy. I originally had a windows hosted account and switched to linux. Apparently that folder did not migrate with the rest of my site, and no you cant change the default folder..at least not on my site.
The problem you have is that you don’t have tmp. The first error says about that:
That’s why the session can’t start. See “…failed: No such file or directory (2) in..“
You need to create
/var/chroot/home/content/08/10125908/tmp/and set read/write permission on that directory.You can change session temp direcotry by using the next function from your php script:
The warnings you get after this one tell you that there was some data sent back to your browser – which was actually the first warning text. It will be fixed right after you fix tmp directory issue.