title: Set a cookie for variable PHP
body: <p>I have a question for php
  How can I set a cookie for a variable after pressing an option from a Select tag?</p>
  
  <pre><code>&lt;select name="selection"&gt;
  &lt;option value="setName"&gt;set name&lt;/option&gt;
  &lt;/select&gt;
  
  $select = $_POST['selection'];
  
      if($select == "setName"){
      $name = "John Johnson";
  
      }
  echo $name;
  </code></pre>
  
  <p>The selection works great and it sets the value for the variable after making the selection but.....
  what I want to do , is set a COOKIE that can store that value for the variable so after I reload the page it will print "John Johnson" without having to make the selection again.</p>
  
  <p>Any ideas how to do that?</p>