title: How would I get a notification bar to display only once per session?
body: <p>I have a notification bar that I only want to display once per session, or possibly not have the notification display for a predetermined amount of time. I am using session storage but unfortunately I cant get it to work correctly.</p>
  
  <p>Thanks</p>
  
  <p>Here is my code -----------></p>
  
  <pre><code>    &lt;script&gt;
  $(document).ready(function() {
  
              var $alertdiv = $('&lt;div id = "alertmsg"/&gt;');
              $alertdiv.text("Join our email list and receive the latest updates at 3Elements Review.");
              $alertdiv.bind('click', function() {
                  $(this).slideUp(200);
              });
              $(document.body).append($alertdiv);
              $("#alertmsg").fadeIn("slow"); 
              setTimeout(function() { $alertdiv.fadeOut(400) }, 6000);
                              });
  
  $(window).load(function(){
          if(typeof(window.sessionStorage) != 'undefined') {
          $("#alertmsg").val(window.sessionStorage.getItem('mySessionVal'));
              window.sessionStorage.setItem('mySessionVal', $("#alertmsg").val());
              window.sessionStorage.setItem('storedWhen', (new Date()).getTime());
      }
  });
  &lt;/script&gt;
  </code></pre>