On the session and cookie

What is a cookie?

Cookie is some of the data stored in a text file on your computer, the user for access to the record store.

What is a session?

session is a data structure used to track the status of the user stored in the server.

It is a kind of conversation technique.

session and cookie difference:

In fact, the evolution session is over on the basis of the cookie.

cookie stored in the local browser, while the cookie is stored on the server.

Because the cookie is stored in the local browser, so we can find a local browser cache data tampering, as very low so that security, you think about it, by getting your local cache you can get your account data, which is very unsafe . After the session but it was after the client logs in, the server creates a corresponding session, session is created, the session ID will be sent to the client, the client is stored in the local browser. So each access server will take sessionID, find the corresponding session in memory, will be able to work properly.

cookie has a limited capacity, each station number also has the following limitations cookie, session and no limit

cookie and session storage are also differences:

session can be stored in sub-redis, database, application, and cookie can only be stored in your browser.

 

Guess you like

Origin www.cnblogs.com/zhao-hao/p/11988583.html