title: How to store data in cookies using php?
body: <p>I am new in PHP and don't have much knowledge about cookies.</p>
  
  <p>It seems that I must store my data in cookies because I just need those data temporarily. I have read some article and tried some of it but I get blank result from it.</p>
  
  <p>here is my code:</p>
  
  <pre><code>&lt;?php
  if (isset($_COOKIE['vaccine'])) {
  setcookie('vaccine',$vaccine);
  foreach ($_COOKIE[$vaccine] as $vaccine){ ?&gt;
  
  &lt;div class="control-group"&gt;
  &lt;label class="control-label"&gt;
  &lt;?php echo '&amp;nbsp'.'&lt;a href="javascript:void(0);"  rel="tooltip"    
   title="Delete" onclick="delete_vaccination('.$vaccine-&gt;vaccination_record_id.');"&gt;&lt;i class="icon-minus-sign"&gt;&lt;/i&gt;&lt;/a&gt;'.'';?&gt;&lt;?php echo $vaccine-&gt;vaccination_record_brand;?&gt;
  
  &lt;/label&gt;
  &lt;/div&gt;
  
  &lt;?php }} ?&gt;
  </code></pre>