Understanding of session objects in JSP

Source: Internet
Author: User

JSP Session Object comprehension: 2008.10.9

The Session Object implements the httpsession interface to save the status of each user. The Session object is saved in the container, and sessionid is sent back and forth between the server and the client through cookie. If the client does not support cookies, it will be automatically converted to URL rewriting.

 

Generally, when a client accesses a web application for the first time, the container creates a session object for it. The session object has a unique ID. In the container's response to the first access, the container sends the unique ID to the client browser through cookie. The browser sends the cookie to the server for each subsequent access. The Container obtains the sessionid from the cookie and finds the Session of the user in the container according to the sessionid. Therefore, a user's multiple HTTP requests correspond to the same session object.

 

Session Timeout: on the one hand, the container needs to save and manage session objects, which will occupy system resources; on the other hand, for security reasons, if the user does not exit the system normally, the user should be able to automatically exit the system after a period of time. Therefore, the session times out. When the session times out, the attributes of the session object and Session object are destroyed by the container.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.