title: PHP session_start error (no such file or directory found)
body: <p>I am fairly new to PHP and I am trying to create a login system where the the username is stored in PHP cookie through session. So through a video tutorial I learnt that I use session_start(); to start the the cookie session then set the variable if the condition is met. I am using XAMPP to test my PHP, so when I load the page, I get this error:</p>
  <blockquote>
  <p>Warning: session_start() [function.session-start]: open(Desktop\xampp\tmp\sess_5bre7v153kb1hoftovugl77o52, O_RDWR) failed: No such file or directory (2) in C:\Users------\Desktop\xampp\htdocs[folder]\checkLogin.php on line 2</p>
  <p>Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Users----\Desktop\xampp\htdocs[folder]\checkLogin.php:2) in C:\Users----\Desktop\xampp\htdocs[folder]\checkLogin.php on line 2</p>
  <p>Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Users----\Desktop\xampp\htdocs[Folder]\checkLogin.php:2) in C:\Users----\Desktop\xampp\htdocs[Folder]\checkLogin.php on line 2</p>
  <p>Warning: Cannot modify header information - headers already sent by (output started at C:\Users----\Desktop\xampp\htdocs[Folder]\checkLogin.php:2) in C:\Users----\Desktop\xampp\htdocs[Folder]\checkLogin.php on line 19</p>
  <p>Warning: Unknown: open(----\Desktop\xampp\tmp\sess_5bre7v153kb1hoftovugl77o52, O_RDWR) failed: No such file or directory (2) in Unknown on line 0</p>
  <p>Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (----\Desktop\xampp\tmp) in Unknown on line 0**</p>
  </blockquote>
  <p>I do have a temp folder in my XAMPP files, where it specifies that do not delete this folder as it has to be there for PHP to create sessions.
  Here is my PHP code:</p>
  <pre><code>    &lt;?php
  session_start ();
  if (isset($_POST[&quot;submit&quot;])) {
    $username = $_POST[&quot;username&quot;];
    $password = $_POST[&quot;password&quot;];
    $check = false;
    $information = fopen(&quot;user_information.txt&quot;, &quot;r&quot;);
    while (!feof($information)) {
      $content = explode(&quot;:&quot;, rtrim(fgets($information, 1024)));
      if ($username == $content[0] &amp;&amp; ($password) == $content[1]) {
           $check = true;
           break;
      }
    }
    fclose($information);
  
    if ($check) {
       define('BASE_URL', 'index.php');
       header('Location: ' . BASE_URL);
       $SESSION[&quot;username&quot;] = $username;
      }
    else {
       define('BASE_URL', 'login.php');
       header('Location: ' . BASE_URL);
    }
      }
  ?&gt;
  </code></pre>
  <p>Thank you</p>