When creating a web application, and lets say you have a User object denoting a single user, what do you think is the best way to store that the user has logged in?
Two ways I've thought about have been:
- Stored the user database id in a session variable
- Stored the entire user object in a session variable
Any better suggestions, any issues with using the above ways? Perhaps security issues or memory issues, etc, etc.