How to set the cookie storage time when using $cookies in angularJS
I'm the porter of the answer: http://stackoverflow.com/questions/12624181/angularjs-how-to-set-expiration-date-for-cookie-in-angularjs
angular.module('cookiesExample', ['ngCookies']) .controller('ExampleController', ['$cookies', function($cookies) { // Find tomorrow's date. var expireDate = new Date(); expireDate.setDate(expireDate.getDate() + 1); // Setting a cookie $cookies.put('myFavorite', 'oatmeal', {'expires': expireDate}); }]);
I'm the porter of the answer:
http://stackoverflow.com/questions/12624181/angularjs-how-to-set-expiration-date-for-cookie-in-angularjs