title: Cookie add on button hit
body: <p>I have a problem with adding a cookie. Read a couple of answers, but it's hard to understand if you never worked with them before.</p>
  
  <p>What I basically want is to add a cookie if someone click on the specified button. So for example, if person clicked on the "like button", hidden content will be revealed no matter if he go forward/back or refresh page and cookie shall be removed after a couple of days.</p>
  
  <p>What I used to hide the content is following:</p>
  
  <p><strong><em>HTML:</em></strong></p>
  
  <pre><code>&lt;div id="fd"&gt;
      &lt;p&gt;Button from below will become active once you hit like button!&lt;/p&gt;
      &lt;div id="get-it"&gt;
          &lt;a class="button"&gt;&lt;img src="img/get-button.png"&gt;&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div id='feedback' style='display:none'&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong><em>javascript:</em></strong></p>
  
  <pre><code>FB.Event.subscribe('edge.create', function (response) {
      $('#feedback').fadeIn().html('&lt;p&gt;Thank you. You may proceed now!&lt;/p&gt;&lt;br/&gt;&lt;div id="get-it"&gt;&lt;a class="button2" href="pick.html"&gt;&lt;img src="img/get-button.png"&gt;&lt;/a&gt;&lt;/div&gt;');
      $('#fd').fadeOut();
  });
  </code></pre>
  
  <p>However if I hit refresh or go back/forward on the content page, it will be hidden again. This is reason why I want to add a cookie on button hit. Anyone who can give me some explanations or example code? </p>