title: how to create a popup with cookies in javascript?
body: <p>I'm trying to create a pop up and set cookies expire in 30 sec and displays a  popup when the page loads just once . the problem is my popup it pop ups but my cookies does not work I do not know whats wrong with my code i tired few things but it did not work also i watched few videos.I'm working on this since this morning if you could help me with you are making my day.any help appreciate it in advance. </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 lang="en"&gt;
  &lt;head&gt;
    &lt;!-- Bootstrap Core CSS --&gt;
    &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"&gt;
    &lt;!-- Latest jQuery Library --&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;!-- Bootstrap Core JS --&gt;
    &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;!-- Cookie JS for Modal --&gt;
    &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.0/jquery.cookie.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
   $(document).ready(function(){
    $("#myModal").modal('show');
   });
   
   
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div class="container-fluid"&gt;
  &lt;div id="myModal" class="modal fade"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                &lt;h3&gt;REGISTER FOR FALL SESSION&lt;/h3&gt;
         
              &lt;/div&gt;
     
              &lt;div class="modal-body"&gt;
     &lt;div class="row"&gt;
      &lt;div class="col-xs-12 col-sm-6"&gt;
                  &lt;img src="gym.png" alt="gym_promo" style="width:304px;"&gt;
      &lt;/div&gt;
      
     &lt;div class="col-xs-12 col-sm-6"&gt;
      &lt;h3&gt; Reserve Your Spot Today &lt;/h3&gt;
      &lt;p&gt; EMAIL : &lt;a href="mailto:PLAYATGYM@GMAIL.COM" target="_top"&gt;PLAYATGYM@GMAIL.COM &lt;/a&gt; &lt;/p&gt;
      
      &lt;p&gt;OR CALL :&lt;a href="514-795-4266"&gt; 514-795-4266&lt;/a&gt; &lt;/p&gt;
      
      
      &lt;script&gt;createCookie();&lt;/script&gt;
          
              &lt;/div&gt;
     &lt;/div&gt;
     &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
    &lt;script&gt;
     function createCookie(name, value) {
     var date = new Date();
     date.setTime(date.getTime()+(30*1000));
     var expires = "; expires="+date.toGMTString();
  
     document.cookie = name+"="+value+expires+"; path=/";
  }
    &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;                            </code></pre>
  </div>
  </div>
  </p>