HTTP protocol
Brief introduction of HTTP Protocol:
Protocol rules: content itself (protocol header, protocol content)
Transmission plaintext shows that the security is poor.
Stateless protocol, session,cookie is required to record the status
Application layer protocol, standardizing HTTP version 1.1
Status code:
1, 2, 3: successful response, 4: request error, 5: server error.
Http request:
Get: get URL resources from the server
Post: sending data to the server
Session and cookie in Http protocol:
Both a.session and cookie are generated by the server
Both b.session and cookie correspond to key values, and both are used to store specific state values, which are used to realize the logic of "dependency".
C.session is saved on the server and cookie on the client
d. Usually, the ID of session is returned to the client as cookie
Both e.sessiob and cookie have lifecycles, and the lifecycle of cookie is affected by the lifecycle of cookie itself and the client, if the client cleans up cookie,cookie failures. The life cycle of session is affected by the life cycle of session itself and whether the client is closed or not. although session ID is returned to the client in the form of cookie, it is not managed by the cookie container of the client, but is related to the process of the client, that is, if the client process is not closed, session will not fail on the client.