Servlet Session API

Hi to All Please let me know what is "Servlet Session API". Someone on JavaRanch said that we don't require the passing of session related info. between clinet and server if we use this API.

Is it true?

Regards Amit

Ulf Dittmer

Rancher

Posts: 42969

73

posted 10 years ago

The API revolves around the javax.servlet.http.HttpSession interface, and a few related interfaces and classes in that package. It maintains session information between requests by passing session IDs either through cookies, or by rewriting URLs to contain that ID. Both ways round-trip the ID (though not the session information itself) from the server to the client back to the server, so the statement you quote is questionable.

Amit Tayal

Ranch Hand

Posts: 51

posted 10 years ago

Even I was thinking the way you do but I saw a question on Javaranch where someone supported the way of maintaining session without passing session data bet. client and server.

Also, obviously something must be transferred back and forth between client and server, if not the actual information, then an ID of some kind to where the information is stored on the server (which can be done through all 4 mechanisms). Is seems to me that "session information" is not sufficiently defined.