jquery.cookie.js时间设置

      var expiresDate= new Date();
            expiresDate.setTime(expiresDate.getTime() + (120*60*1000));
            $.cookie('username', res.data.username, { expires: expiresDate, path: '/'  });        

 cookie缓存2小时写法

原文地址:https://www.cnblogs.com/liyinSakura/p/7715847.html