0

I have created a mean stack authentication project. If I post username and password from html form, then after successful login the server generate a session and the encrypted session id is automatically saved on my browser cookie.

<form action="myServerPath/login" method="post">
 <input type="text" name="username" id="username" placeholder="username">
 <input type="password" name="password" id="password" placeholder="password">
 <input type="sucbmit" value="submit">
</form>

But If I try to use $http.post() method of angularjs, server generates a session but the session ID is not saved on the browser cookie. I used the withCredentials property to true this sends the cookie to the server but can't save the cookie. Can anybody tel me how to solve it??

Mamunur Rimon
  • 65
  • 1
  • 8
  • http://stackoverflow.com/questions/3393854/get-and-set-a-single-cookie-with-node-js-http-server this might help – Abdul Rehman Sayed Jul 20 '16 at 14:22
  • Not getting the solution. There is no problem for setting and getting cookie with angularjs and nodejs. But the problem is : when a session is created on server , the encrypted session id is automatically saved on browser cookie. But for $http.post(), this mechanism doesn't work. – Mamunur Rimon Jul 21 '16 at 08:57

0 Answers0