Save user - Angular2/4

Asked

Viewed 355 times

-1

I’m new at angular. Take away a question how could you save me logged in user, so I don’t lose my user if browsing is reloaded ? As if it were a PHP session. Thank you for your attention.

1 answer

1

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.