Can a COOKIE be placed on the server? How can I identify a browser? No? Why? Can a COOKIE be placed on the server? How can I identify a browser? No? Why?
Reply content:
Can a COOKIE be placed on the server? How can I identify a browser? No? Why?
No.
Because the HTTP protocol is stateless, that is, the server does not know what the user did last time, which seriously hinders the implementation of interactive Web applications. In typical online shopping scenarios, users browsed several pages and bought a box of cookies and two drinks. During the final checkout, the server does not know what the user has bought because of the stateless HTTP. Therefore, cookies are one of the "Additional methods" used to circumvent the stateless nature of HTTP. The server can set or read information contained in Cookies to maintain the state of the user's session with the server.
In the shopping scenario just now, when the user buys the first item, the server also sends a Cookie while sending the webpage to the user, recording the item information. When a user accesses another page, the browser sends the Cookie to the server, so the server knows what he bought before. The user continues to purchase drinks, and the server adds new product information to the original Cookie. During the checkout, the server can read the sent Cookie.
By the way, the server has an HTTP Session.
Isn't cookie a string of small text that will be carried by the browser every time you request it? What is the concept of putting it on the server?
Yes. The client on the server cannot access it --#
What do you want to do ......