Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Statelessness and Cookies | Security and the Complete Web Journey
How the Web Works

bookStatelessness and Cookies

To understand how the web keeps track of users, you need to know that HTTP—the protocol browsers and servers use to communicate—is stateless. Statelessness means that each HTTP request is treated as a completely independent event. When your browser sends a request to a server, the server processes it and responds, but does not remember anything about previous requests from you. There is no built-in way for the server to know whether two requests came from the same person or from different people.

index.html

index.html

copy

Because HTTP is stateless, websites need a way to keep track of users as they move from page to page or return later. Cookies provide this solution. A cookie is a small piece of data that the server asks your browser to store and send back with each request. By setting a cookie (like a session ID), the server can recognize your browser on future requests. This is how features like staying logged in, shopping carts, and user preferences are possible—your browser sends the cookie back, and the server uses it to retrieve your session data.

You can think of cookies as claim tickets at a coat check. When you leave your coat, you get a ticket. Later, you show the ticket to claim your coat. Similarly, when you visit a website, the server gives your browser a "ticket" (cookie). Each time you come back, you show your ticket, and the server remembers who you are and what you were doing. Without cookies, the server would not recognize you, just like a coat check without claim tickets would not know which coat belongs to which person.

question mark

What does it mean that HTTP is 'stateless'?

Select the correct answer

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 1

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

Awesome!

Completion rate improved to 8.33

bookStatelessness and Cookies

Swipe um das Menü anzuzeigen

To understand how the web keeps track of users, you need to know that HTTP—the protocol browsers and servers use to communicate—is stateless. Statelessness means that each HTTP request is treated as a completely independent event. When your browser sends a request to a server, the server processes it and responds, but does not remember anything about previous requests from you. There is no built-in way for the server to know whether two requests came from the same person or from different people.

index.html

index.html

copy

Because HTTP is stateless, websites need a way to keep track of users as they move from page to page or return later. Cookies provide this solution. A cookie is a small piece of data that the server asks your browser to store and send back with each request. By setting a cookie (like a session ID), the server can recognize your browser on future requests. This is how features like staying logged in, shopping carts, and user preferences are possible—your browser sends the cookie back, and the server uses it to retrieve your session data.

You can think of cookies as claim tickets at a coat check. When you leave your coat, you get a ticket. Later, you show the ticket to claim your coat. Similarly, when you visit a website, the server gives your browser a "ticket" (cookie). Each time you come back, you show your ticket, and the server remembers who you are and what you were doing. Without cookies, the server would not recognize you, just like a coat check without claim tickets would not know which coat belongs to which person.

question mark

What does it mean that HTTP is 'stateless'?

Select the correct answer

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 1
some-alt