A) When the user logs in, the browser adds a cookie to the response when it returns
b) The browser will automatically save after receiving the cookie
c) When the user requests another page from the same server again, the browser will automatically bring the previously saved cookie
d) After the service receives the request, it can ask the requesting object to take a cookie to determine whether the current user is logged in
HTTP is stateless, is connected data interoperability, closed is permanent amnesia, why is it stateless? Because the browser and the server use the socket communication Ah, once the browser is closed, after four waves to destroy all the interactive information (talk about the TCP three-time handshake, Four waves) So what's the way to keep a state between the browser and the server, the cookie and the session difference: The cookie is stored in the browser, and each visit to the website will send the local saved cookie value (user's personal information) to the corresponding website, unsafe, The cookies under each domain name exist independently and do not interfere with each other. Seesion relies on cookies, but it is stored on the server and is more secure than cookies.
The principle of HTTP State retention