Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - cookie plugin expiry time in minute

0 votes
56 views
added Nov 19 in jQuery by LC Marshal Lieutenant (14,830 points)
$(function() { 
    var expDate = new Date();
    var minutes = 3;
    expDate.setTime(expDate.getTime() + (minutes * 60 * 1000));
    $go = $.cookie('sto-cookie');
    if ($go == null) {
        $.cookie('sto-cookie', 'test', { path: '/', expires: expDate });
        window.location = "/example"
    }
    else {
        // do nothing
    }
});

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...