title: jQuery cookie pop-up to show only once per session
body: <p>I use this code to show pop-up to users only once per session. It works but it will show once only on a specific URL. For example, if a user visits <code>www.mydomain.com/some-url-1</code> it will show only once on that URL, but if a user visits a different URL <code>www.mydomain.com/some-different-url</code> the pop up will show up again.</p>
  
  <p>I want it to show only once <strong>across whole domain</strong> instead.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;div id="trex-widget391" class="trex-popup-widget"&gt;&lt;/div&gt; 
     &lt;script&gt;
         function trexCallback391(trex){document.getElementById("trex-widget391").innerHTML=trex.html;}
         jQuery(".trex-popup-widget").mouseover(function(e){
             if(document.cookie.indexOf("popup_trex") ===-1) {
                 jQuery("#trex_overlay_fsl_popup").fadeIn('slow');
                 expiry = new Date();expiry.setTime(expiry.getTime()+(10*60*1440000)); 
                 document.cookie = "popup_trex=yes; expires=" + expiry.toGMTString();
             }
         });
     &lt;/script&gt; 
     &lt;script src="http://clanci.geek.hr/widget/widget.php?id=391" async defer&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Does anyone know what needs to be modified to show pop-up only once across whole domain and its subdomains?</p>