The HTTP protocol is stateless, that is, the server can only respond to HTTP requests that you submit at this time. Cookies can be used to tag clients on the server side. such as after the login password-free, shopping cart implementation.
Cookies
Cookies can be generated by JS code, or by server-side code.
A cookie consists of a property such as name, value, domain, and a column that can be viewed.
A cookie is included, and the next time it is accessed, it contains a cookie in the HTTP request and can have many cookies.
Sessinid nature is still a cookie. SessionID an object on the server that can store a variety of information, usually in memory. When the client requests the session object for the first time, the server creates a session for the client, and the ID of the session is calculated by a special algorithm, which is used to identify the session object, and when the next time the session continues to be valid, the browser requests other resources. The browser automatically places the SessionID in the request header, the server receives the request SessionID, and the server finds the session of the ID to be returned to the requestor (Servlet) for use.
Microsoft's SessionID
SessionID of JSP
Difference
The cookie data is stored on the client's browser and the session data is placed on the server.
Cookies and Sessonid