2017-01-28 58 views
0

我已经在使用过期时间的angularjs中使用过$ cookieStore,但过期时间不起作用。

看看这段代码...

var today = new Date(); 
var expiresValue = new Date(today); 
//Set 'expires' option in (365 x 24 x 60 x 60) = 31536000 seconds = 1 year 
expiresValue.setSeconds(today.getSeconds() + 31536000); 
// Setting a cookie 
$cookieStore.put('STYPE', response.data.type, {'expires' : expiresValue}); 

我如何可以设置angularjs到期时间。

+0

能否请您选择的答案,如果它帮助你的 –

回答