How an authentication validation works with Angular + PHP

2

I'm starting angular (version above 2) I'm studying angular communication with PHP, in the httpClient part (of rxjs) to make the GET, POST, PUT and DELETE understood well. My question is how does this work to login? From what I understand so far it's like this:

I have a form send the login and password via angled POST, then in PHP I validate this in MySql and if the login and password are right I generate a token in PHP, store that token in a PHP session and send it to store also in the session storage of the browser, then I always compare the token of the session storage with the token there of the session PHP and thus will know if the usr already is logged.

Would it work anyway? I would like to understand this part better.

    
asked by anonymous 29.10.2018 / 23:45

0 answers