I'm new in AngularJS. I use Drupal as Backend for APIs.
So this is my problem:
When the user is logged-in, Drupal saves automatically the SessionNAME = SessionID in the cookie to keep the user logged-in so on refresh the user is still logged-in but i loose the userId, the username, his email, his favorite movies...
My solution was: sending a request to the server in
Here's the practice I follow and is usually used:
create session on server -> store the user object and important info in localstorage e.g.
Refresh Page (check session) check session(if logged in) -> get the user data from localStorage and use it e.g
UserService.user = localStorage.getObject("myApp_user");
MoviesService.movies = localStorage.getObject("myApp_movies");
close session call on server->remove cookies->remove data from localStorage.. e.g.
Hope this helps.