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 :slight_smile: 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

<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>

Hi,

couldn’t you just do:

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

Or did I miss something?

That was fast!

You had to missed something! :slight_smile:

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

Thanks

You didn’t miss anything it works.