title: Check if user has alread visited site in browser session
body: <p>So I have this splash screen animation that plays when you visit my website. However, I only want the animation to play the first time you visit it (in the session of course). I tried to make an if else where I check for a cookie called "Session", and if it exists, delete the div containing the animation. If there is no such cookie, create it.</p>
  
  <p>Code:</p>
  
  <pre><code>function session() {
      if (document.cookie.indexOf("visited") &gt;= 0) {
          $('.splash').remove(this);
      } else {
          document.cookie = "visited";
      }
  }
  </code></pre>
  
  <p>I have never used cookies before so I think I might have made some errors</p>