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??