Recommend on Google

Use following code to expire a cookie in x minutes using jQuery.

var date = new Date();
date.setTime(date.getTime() + (x * 60 * 1000));
$.cookie('example', 'foo', { expires: date });
 

Leave a Comment