I am handling sessions by storing the user data in the sessionStorage of the browser using AngularJs. The basic flow I am using is as follows:
- Login by front-end
- Returning the user from node i.e back-end
- Storing the returned data in sessionStorage
- sending id of user with every request to the server
- clearing the storage when signing out
Is my approach correct? If not then how can I manage sessions efficiently in a MEAN app?