title: PHP Session not Saving
body: <p>I have this written at the very first line on every page of my website. </p>
  
  <pre><code>include("restd.php");
  </code></pre>
  
  <p>and restd.php contains the following lines : </p>
  
  <pre><code>@session_start();
  if(isset($_SESSION['id']))
  {
  }
  else
  {
    header("location:index.php");
  }
  </code></pre>
  
  <p>The problem i'm facing is that when ever i click or do something on my website. it logs me out and takes me to index.php.</p>
  
  <p>im sure its something to do with the session. ive tried every single thing to avoid this problem but i ahve used restd.php because i dont want anyone to copy the url of someone and paste and get into the website.</p>
  
  <p>anyone who is logged in only can view other's pages. if they arent logged in then they'll be redirected to index.php</p>
  
  <p>EDIT : and guys a confusing thing is that all this is working fine on my testing server which is easyPHP-5.3.8.0 but this problem is coming up when i upload all the files to my server.</p>