I am not sure about your backend, but this is how I would do it
- Create a separate login page (dedicated url not angular sub view or
modal dialog).
- If the user is not authenticated redirect to this login
page. This is done by server redirects. This page may or may not use
angular framework, as it just involves sending a user\password to
server.
- Make a POST (not AJAX request) from the login page, and verify on server.
- On the server set the auth cookie. (Different frameworks do it differently. ASP.Net sets form authentication cookie.)
- Once the user is authenticated redirect user to the actual angular app and load all its components.
This saves any code require to manage authentication on client side in Angular. If the user lands on this page he is authenticated and has the cookie.
Also default browser behavior is to send all cookies associated with a domain with each request, so you don't have to worry if angular is sending some cookie or not.