Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda 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

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 1

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain more about how cookies work technically?

What are some security concerns with cookies?

Are there alternatives to cookies for tracking users?

Awesome!

Completion rate improved to 8.33

bookStatelessness and Cookies

Deslize para mostrar o menu

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

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 1
some-alt