jQuery Cookie Time Set


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($) {
    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"});


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.


You didn’t miss anything it works.