title: How to set expire time in cookies AngularJS (1.4)?
body: <p><strong>In case of user login I want to save the user data in cookies so that I can use that when the browser is closed and again open the website.</strong> For adding cookies I am using angular-cookies.js which given by angular. (<a href="https://docs.angularjs.org/api/ngCookies" rel="nofollow noreferrer">https://docs.angularjs.org/api/ngCookies</a>)</p>
  
  <p><code>angular.module("app", ['ngCookies']);</code> <em>(This is added)</em> <br>
  <code>app.controller("xyzController", function ($cookieStore) {});</code> <em>(cookies is added into the controller)</em></p>
  
  <p>Inside the function when I am storing the cookies I am using this code: <br>
  <code>var expireDate = new Date();
  expireDate.setDate(expireDate.getDate() + 10);
  $cookies.put('data-login-user',JSON.stringify($scope.loginuser),{'expires': expireDate});</code>
  <br>In this case the cookies is adding but it is going to session cookies. There is no expire time but according to the code I am passing 10days expire time which is not setting up in cookies.<br><br>
  <strong>So how can i add expire time to cookies by using this library?</strong></p>
  
  <p><a href="https://i.stack.imgur.com/1th9Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1th9Y.png" alt="enter image description here"></a></p>
  
  <p>The red mark cookies are the cookies which is pushed by this code by its going to session cookies</p>