title: Can't see my session variable in the third/last page?
body: <p>I'm having trouble viewing the session variable in the last page.  User should be able to submit a name, then the second page should ask you to "click here" to view the name or session variable in the final page.
  Thank you for the help!</p>
  
  <p>1) first page submits name with form:</p>
  
  <pre><code>&lt;form action="Cookies&amp;SessionVariables2.php" method="post"&gt;
      &lt;img src="question.png" alt="WhatIsYourAlias?"&gt;
      &lt;input name="alias" size="60" type="text"&gt;
      &lt;button id="button" type="submit"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>2) second page says "Click here to view it":</p>
  
  <pre><code>&lt;?php
  //Handle the form if it has been submitted:
  if (isset($_POST['alias'])){
  
      //Send the cookies:
      setcookie('alias',$_POST['alias']);
  }
  ?&gt;
  
  &lt;?php
  
  //Check if the form has been submitted:
  if ($_SERVER['REQUEST_METHOD']=='POST'){
  
      //Handle the form:
      if((!empty($_POST['alias']))){
  
          //Do session stuff
          session_start();
          $_SESSION['alias'] = 
          $_POST['alias'];
  
          //Message to be printed:
          echo $msg = '&lt;p&gt;Your Alias has been entered! Click &lt;a href="Cookies&amp;SessionVariables3.php"&gt;here&lt;/a&gt; to view it!&lt;/p&gt;';
       }
  
          //Forgot field
          else {
              print'&lt;p&gt;Awww! You did not submit your Alias! Please click &lt;a href="Cookies&amp;SessionVariables.php"&gt;here&lt;/a&gt; and try again!&lt;/p&gt;';
          } 
  }     
  ?&gt;
  </code></pre>
  
  <p>3) third page should show the session variable:</p>
  
  <pre><code>&lt;?php
  
  //Need the session:
  session_start();
  
  print '&lt;p&gt;Hello, ' . $_SESSION['alias'] . '!&lt;/p&gt;';
  ?&gt;
  </code></pre>