title: Show popup only once per session
body: <p>This is my current code. How can I show the popup only once per session? It's an image popup that exists on a magento checkout page basically promoting an add on product</p>
  
  <pre><code>&lt;!-- Trigger/Open The Modal --&gt;
  &lt;style&gt;&lt;!--
  .button {
    display:none!important;
  --&gt;&lt;/style&gt;
  &lt;div class="button"&gt;&lt;button id="myBtn"&gt;.&lt;/button&gt;&lt;/div&gt;
  &lt;!-- The Modal --&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;style&gt;&lt;!--
  @media (max-width: 979px) {  
  
  .modal {
      display:none!important;
  }
  }
  --&gt;&lt;/style&gt;
  &lt;div id="myModal" class="modal"&gt;&lt;!-- Modal content --&gt;
  &lt;div class="modal-content"&gt;&lt;img id="Image-Maps-Com-image-maps-2016-09-01-150341" alt="" src="http://www.prowrestlingtees.com/images/checkoutpopup.png" height="312" width="432" usemap="#image-maps-2016-09-01-150341" /&gt; &lt;map id="ImageMapsCom-image-maps-2016-09-01-150341" name="image-maps-2016-09-01-150341"&gt; 
  &lt;area style="outline: none;" title="" shape="rect" coords="0,249,208,306" href="http://www.prowrestlingtees.com/pwcrate-collectible.html" alt="" target="_self" /&gt;
   &lt;span class="close"&gt; 
  &lt;area style="outline: none;" title="" shape="rect" coords="222,252,429,307" alt="" target="_self" /&gt;
   &lt;/span&gt; 
  &lt;area style="outline: none;" title="Image Map" shape="rect" coords="430,310,432,312" href="http://www.image-maps.com/index.php?aff=mapped_users_0" alt="Image Map" /&gt;
   &lt;/map&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;style&gt;&lt;!--
  /* The Modal (background) */
  .modal {
      display: inline; /* Hidden by default */
      position: fixed; /* Stay in place */
      z-index: 1; /* Sit on top */
      left: 0;
      top: 0;
      width: 100%; /* Full width */
      height: 100%; /* Full height */
      background-color: rgb(0,0,0); /* Fallback color */
      background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
  }
  
  /* Modal Content/Box */
  .modal-content {
      margin: 15% auto; /* 15% from the top and centered */
      text-align: center;
      width: 80%; /* Could be more or less, depending on screen size */
  }
  
  /* The Close Button */
  .close {
      color: #aaa;
      float: right;
      font-size: 28px;
      font-weight: bold;
  }
  
  .close:hover,
  .close:focus {
      color: black;
      text-decoration: none;
      cursor: pointer;
  }
  --&gt;&lt;/style&gt;
  &lt;script type="text/javascript"&gt;// &lt;![CDATA[
  // Get the modal
  var modal = document.getElementById('myModal');
  
  // Get the button that opens the modal
  var btn = document.getElementById("myBtn");
  
  // Get the &lt;span&gt; element that closes the modal
  var span = document.getElementsByClassName("close")[0];
  
  // When the user clicks on the button, open the modal 
  btn.onclick = function() {
      modal.style.display = "block";
  }
  
  // When the user clicks on &lt;span&gt; (x), close the modal
  span.onclick = function() {
      modal.style.display = "none";
  }
  
  // When the user clicks anywhere outside of the modal, close it
  window.onclick = function(event) {
      if (event.target == modal) {
          modal.style.display = "none";
      }
  }
  // ]]&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Anyway to make this work? Thanks for any help</p>