title: Set Cookie or localStorage for Cookie Banner with JavaScript
body: <p>I'm working on a Cookie Banner project and I got everything i need exept one thing: - As soon as the User clicks on "Accept" the Cookie Banner disapears and now comes my Problem: I want to set something like a Cookie or localStorage so the User doesnt get annoyed by seeing the Cookie Banner on each Page or after each reload. </p>
  
  <p>I hope you get what I'm trying to say. </p>
  
  <p>Here is my Code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script&gt;
     $(document).ready(function(){
      $("#Accept").click(function(){
      $('#CookieBanner').hide();
      });
     });
    &lt;/script&gt;
    
    &lt;div id="CookieBanner"&gt;
      &lt;div class="agj"&gt;
      &lt;div class="agj-content"&gt;
       &lt;div class="initial-info"&gt;
        &lt;h2 class="title"&gt;Privacy&lt;/h2&gt;
        
        &lt;p class="message"&gt;
         This website uses cookies to provide you with the best possible service and website functionality, and to provide social media features and analyse the traffic to our website. If you continue to use our website, you agree to our using cookies.
        &lt;/p&gt;
        
       &lt;/div&gt;
       &lt;div class="buttons"&gt;
       &lt;button id="Accept"&gt;Accept&lt;/button&gt;
       &lt;a class="link" href="#" title="Get more Information about Cookies and how we use them"&gt;Show Purposes&lt;/a&gt;
       &lt;/div&gt;
      &lt;/div&gt;
     &lt;/div&gt;
    &lt;/div&gt;
  &lt;!--- here I would like to set a JavaSript Cookie or localStorage so the User doesnt get the Banner after clicking Accept again ---&gt;
  
   &lt;/head&gt;</code></pre>
  </div>
  </div>
  </p>