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 :

developping tools cookies vue

be carefull use of $cookiestore because it's depreciated since v1.4.0


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -