How does a web server identify a request in Java?

Consider senario, I use servlets with the httpSession object in the servlet, and add some data to the session object, and the response sent to the client and client sends a request to the next page of the servlet that needs the information stored in the session object. Now, how can the web server notify the request specified by the client is associated with the perticular session object created by the previous request? Suppose cookies are disabled?

+3
source share
3 answers

If cookies are not allowed, session tracking occurs with a rewriting of URLs. Each server url must be encoded with a session id (HttpResponse.encodeURL () does this for you).

. POST.

+1

, - , , perticular session, ?

cookie. cookie , .

cookie jar, , , cookie jsessionid, .


, , URL . cookie - .

+2

Cookies are by far the most popular method for implementing http sessions on Java web servers. In addition to cookies, you can use two more methods - rewriting URLs (for example, adding additional information to each URL generated by a server that helps to identify a session) and hidden fields embedded in forms whose value contains information necessary for identification session.

0
source

All Articles