angularjs - Set Cookies expiration in angular js -
when user logging in, storing values in cookies received backend. want set cookies' expiration 8 hours. how can that?
i have done not sure if correct or not
var expiredate = new date(); var time = expiredate.setdate(expiredate.getdate() + 1); $cookiestore.put('userdata', record.data.profiledata,{'expires':time});
in chrome developping tools (it's existing in others browsers) can check expiration date of cookies.
you can access functionnalitie in tab application , on left there label cookies :
be carefull use of $cookiestore
because it's depreciated since v1.4.0
Comments
Post a Comment