Brief introduction
The HTTP protocol is stateless. Connections from the client to the server can be closed after each request. However, it is generally necessary to transfer some client information from one page to another.
The root cause of statelessness is that the browser and the server use socket communication, and the server closes the current socket connection after returning the request result to the browser. And the server destroys the Page object after the page has finished processing.
The reason for application is that the HTTP protocol is followed by the communication between the browser and the server.
The HTTP protocol is stateless and will not remember the last and the page "what happened." The server does not remember what was given to the browser last time.
The impact on the site: if the user entered some information, when the jump to the next page, data loss, no longer get those data.
If you want to know the last state information, we have to record this state information somewhere:
A. Server-side
B. Browser side (client)
C. Form elements-such as: Hidden domain <input type= "hidden"/> (HTTP message)
In the various ways in which the state is saved, the main difference is whether the state is stored on the client or server, and the following table lists the various state management techniques and when the status remains valid.
First of all, the state management of the five basic concepts together to facilitate the comparison of memory.
There is a more granular solution on the network, as shown in the following illustration:
Client's state retention scheme: ViewState, hidden fields, Cookies, control state, URL query parameters
Server-side State retention Scenarios: session (Sessions), Application, Caching (cache), database (databases)