Cookies & Sessions
1 sentence:
Cookies & Sessions are used to create a stateful experience/interaction. They are commonly used to check if the user is logged-on
Cookies
- stored on client-side
- keeps your identification(like an identification card)
- 4 kb
- stays until the expiry date set by the server. But if the server doesn’t set the expiry date, the cookies will be pruned once the user leaves the website
Sessions
- (usually) stored on server-side
- work with cookies, the server uses your identification(cookies from client-side) to find your sessions on the server such that the server can provide your information in previous visits
- store sessions of all users
More…, please read Cookies vs LocalStorage vs SessionStorage