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到期時間。
能否請您選擇的答案,如果它幫助你的 –