title: how to use session_start() properly on GoDaddy site
body: <p><strong>Fix Below</strong> My problem had nothing to do with headers having "already been sent". That was simply a symptom of the problem. The <strong>problem ended up being a sever side issue with GoDaddy</strong> as a folder was missing on their end.</p>
  
  <p>I have edited my question's name to include "GoDaddy site" to maybe help someone in the future having the same issue.</p>
  
  <p>Per @KennyPowers suggestion I called Go Daddy. I originally had a windows hosted account and switched to linux. Apparently the folder that <code>session_start()</code> 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.</p>
  
  <p>GoDaddy replaced the folder on their end and everything works fine now</p>
  
  <hr>
  
  <p><strong>Original Question:</strong></p>
  
  <p>I could use a little help using <strong>session_start()</strong></p>
  
  <p><strong>Site flow:</strong></p>
  
  <ul>
  <li><strong>page1.html</strong> has a form which <strong>POSTs to page2.php</strong></li>
  <li><strong>page2.php</strong> does some stuff with the data and presents a <strong>link to
  page3.php</strong></li>
  <li>when <strong>page3.php</strong> loads it also <strong>needs</strong> to do something with <strong>the data from
  the form</strong></li>
  </ul>
  
  <p>All pages are on the same domain so Im trying to do this with session_start()</p>
  
  <p>This is what Ive tried:</p>
  
  <h2><strong>Page 2:</strong></h2>
  
  <pre><code>&lt;?php
  // page2.php
  
  session_start();
  
  echo 'Welcome to page #2';
  
  $_SESSION["guest1Last"] = $_POST["guest1Last"];
  $_SESSION["guest1First"] = $_POST["guest1First"];
  $_SESSION["guest1Middle"] = $_POST ["guest1Middle"];
  
  ?&gt;
  
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Title&lt;/title&gt;
  // more HTML and PHP stuff down here
  </code></pre>
  
  <h2><strong>Page 3:</strong></h2>
  
  <pre><code>&lt;?php
  // page3.php
  
  session_start();
  
  echo 'Welcome to page #3&lt;br /&gt;';
  
  
  echo $_SESSION["guest1First"];  
  echo $_SESSION["guest1Middle"];
  echo $_SESSION["guest1Last"]; 
  
  ?&gt;
  
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  // more HTML and PHP stuff down here
  </code></pre>
  
  <p><strong>These are the warnings I get when page 2 loads:</strong>
  (same thing on page3)</p>
  
  <hr>
  
  <pre><code>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
  </code></pre>
  
  <p>The  <strong><em>"headers already sent"</em></strong> 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   "<strong><em>No such file or directory</em></strong>" 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.</p>
  
  <p><strong>EDIT</strong></p>
  
  <hr>
  
  <pre><code>&lt;?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"];
  
  
  
  ?&gt;
  </code></pre>
  
  <ul>
  <li>I created a folder tmp and gave it all permissions</li>
  <li>I added <code>ini_set('session.save_path',
  '/var/chroot/home/content/08/10125908/html/tmp');</code></li>
  <li>and tried ini_set('session.save_path', 'html/tmp');</li>
  <li>I also created a text file with
  <code>session_save_path('/home/content/04/8260904/html/tmp');</code>  saved it
  as <strong>php.ini</strong> and uploaded it to my root</li>
  <li>I also I also created a text file with<br>
  <code>session_save_path('/home/content/04/8260904/html/tmp');</code>  saved it<br>
  as <strong>php5.ini</strong> and uploaded it to my root</li>
  </ul>
  
  <p>Im still getting the same error</p>
  
  <pre><code> Warning: session_start() [function.session-start]: open(/var/chroot/home/content/08/10125908/tmp/sess_3659a32a50e33e5f918a9e39d70a1668, O_RDWR) failed: No such file or directory  
  </code></pre>
  
  <p>am I not setting the folder destination correctly?</p>
  
  <hr>
  
  <p><strong>My folder setup now</strong>
  <img src="https://i.stack.imgur.com/B6V3K.png" alt="enter image description here"></p>
  
  <p>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.</p>