I'm struggling to understand (and set) the expiration for this cookie I'm using on a site to fire a facnybox popup. My goal is to have the cookie set for one minute.
Cheers, and thanks in advance for any clarification you could provide.
<script type="text/javascript">
$(document).ready(function() {
var check_cookie = $.cookie('index_popup');
var inOneMin = new Date(new Date().getTime() + 1 * 60 * 1000);
if(check_cookie == null){
$.cookie('index_popup', { expires: inOneMin });
//fire your fancybox here
$.fancybox({
maxWidth : '100%',
fitToView : false,
width : '100%',
height : 'auto',
autoSize : false,
href: "#split_popup"
});
}
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div style='display:none'>
<div id='split_popup'>
<p>cool stuff here<p>
</div>
</div>