no stateful HTTP protocol
Stateless means that when the browser sends a request to the server, the server responds to the client request.
But when the same browser sends the request to the server again, the server does not know that it is just that browser.
Simply put, the server is not going to remember you, so it is a stateless protocol.
two major mechanisms for saving User state (Session/cookie)
What is a cookie?
is a series of text messages that the Web server holds on the client.
Typical application one: Determine whether the registered user has logged on to the website
Typical application two: "Shopping cart" processing
The role of Cookies
Tracking for a specific object
Save user Web browsing history and habits
Simplified Login
Security risk: Easy disclosure of user information
Creation and use of cookies
Create a Cookie Object
Cookie Newcookie = new Cookie (String key, Object value);
Write Cookie Object
Response.addcookie (Newcookie);
Read Cookie Object
cookie[] cookies = request.getcookies ();
Common methods
Session vs. Cookie
JSP State Management