title: How to use store and use session variables across pages?
body: <p>When one page is accessed, I would like to start a session and store a session variable:</p>
  
  <pre><code>&lt;?php
    session_start(); 
    $_SESSION['myvar']='myvalue';
  ?&gt;
  </code></pre>
  
  <p>Then from another page, I would like to check if that session variable has been stored:</p>
  
  <pre><code>&lt;?php
      session_start();
      echo("1");
      if(isset($_SESSION['myvar']))
      {
          echo("2");
         if($_SESSION['myvar'] == 'myvalue')
         {
             echo("3");
             exit;
         }
      }
      ?&gt;
  </code></pre>
  
  <p>This code does not work for me.</p>