SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery Cookie Time Set

    Hi,

    I've been looking all over the net to figure out how to set this jQuery to fifteen minutes. Right not it's set for fifteen days. It's a little off I know I could just change the day from 15 t0 1 but still that's to long. I can find settings but nothing that actually works for what I would like i.e. 15 minutes. Thanks

    Code:
    <script type="text/javascript">
    (function($) {
    jQuery(document).ready(function(){
        if (document.cookie.indexOf('visited=true') == -1) {
            var fifteenDays = 1000*60*60*24*15;
            var expires = new Date((new Date()).valueOf() +  fifteenDays);
            document.cookie = "visited=true;expires=" +  expires.toUTCString();
            $.colorbox({width:"680px", inline:true, href:"#subscribe"});
            }
    });
    })(jQuery);
    </script>

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,008
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    couldn't you just do:

    Code JavaScript:
    var fifteenMinutes = 1000*60*15;
    var expires = new Date((new Date()).valueOf() +  fifteenMinutes);

    Or did I miss something?

  3. #3
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That was fast!

    You had to missed something!

    I don't know I'll give it a try.

    Thanks

  4. #4
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You didn't miss anything it works.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •