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

jQuery - Cookie set example

0 votes
20 views
added Feb 12 in jQuery by lcjr Sergeant (2,320 points)
//Cookie configuration
var expAppBanner = new Date();
var exbMin = 3;

expAppBanner.setTime(expAppBanner.getTime() + (exbMin * 60 * 1000));
$abCookie = $.cookie('app-banner');
if ($abCookie == null) {
    $.cookie('app-banner', 'showed', { path: '/', expires: expAppBanner });
    //do here
}
else {
    // cookie at work
}

 

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