What are cookies?
A small piece of data a website asks your browser to store and send back on later requests.
HTTP has no memory. Every request arrives like it's from a stranger. So how does a site remember you're logged in? Cookies.
What it is
A cookie is a small piece of data a website asks your browser to store and send back on later requests.
How it works
When you log in, the server's response includes a Set-Cookie header, with a name and a value, often a session ID. Your browser saves it, and sends it with every request to that site, so the server recognizes you. Cookies can expire, and have flags like Secure, so they only travel over HTTPS, and HttpOnly, so page scripts can't read them.
Why it matters
They power logins, shopping carts and settings. They're also used for tracking, which is why sites ask for your consent.










