HTTP is a stateless protocol, so we often use cookie or session to store the user’s data and state.
1. The main difference between cookies and sessions is that cookies are stored in the user's browser, and sessions are stored in the server side.
2. cookies are only simple text that is usually not over 4096 bytes. Sessions are objects (not text files) that store data.