2014-12-03
1,jQuery设置cookie的过期时间。默认expires是按天计算,但如果想按小时或分钟时该怎么办呢?
var date = new Date(); var minutes = 30; date.setTime(date.getTime() + (minutes * 60 * 1000)); $.cookie("example", "foo", { expires: date });