Save the user - Angular2 / 4

-1

I'm new to the angular. Ask me a question how could I save me logged in user, so that I do not lose my user if the browser is reloaded? Like a PHP session. Thank you for your attention.

    
asked by anonymous 24.08.2017 / 01:38

1 answer

1

You can set the user logged in to the localStorage. For example: When you log in, you can check the user on the backend (in your case, php) and set directly on the localStorage. localStorage.setItem ("user", user);

    
24.08.2017 / 01:58