Sessions are like a temporary memory for websites. When you log in, the server creates a session ID (usually stored in a cookie) to remember you.
It’s not *just* a cookie tho—cookies are just one way to store the session ID. The actual session data lives on the server, so it’s more secure than stuffing everything into a cookie.
For example, when you add stuff to a cart, the site uses your session to keep track. No session? Your cart would empty every time you click a new page.
Check out MDN’s guide on sessions—super helpful for beginners!
It’s not *just* a cookie tho—cookies are just one way to store the session ID. The actual session data lives on the server, so it’s more secure than stuffing everything into a cookie.
For example, when you add stuff to a cart, the site uses your session to keep track. No session? Your cart would empty every time you click a new page.
Check out MDN’s guide on sessions—super helpful for beginners!
