在我的应用程序中,我使用的是 angularJS 1.3,当我$cookies
用来存储一些值时,我需要设置 1 分钟的 cookie 过期时间。angularJs 1.3$cookies
服务没有提供过期时间的方法。这是我到目前为止尝试的代码。
var x = new Date();
x.setMinutes(x.getMinutes() + 1);
$cookies['showStartUpScreen'] = value + ';expires=' + x.toGMTString();