Similarities and differences between session and application in Java

Source: Internet
Author: User

the client's session is actually a sign of which browser your request came from

question 1: Is it always the same?

A : Restart the browser, your session ID will change,

The result is that the data that was previously saved on the server cannot be retrieved.

Issue 2: Assuming that the client's session ID is not changed (the browser does not restart),

so will the server keep the session data?

A : The service side (Tomcat) if There is no one moving,

then this session will be destroyed automatically.

For application throughout the project, there are only 1 variables, and all clients share the same Application object.

Only when the Tomacat is closed will application be destroyed.

the similarities and differences between Session attributes and application

1, session and application,request in Configuration Properties , code-like

2, session for each user (browser) is separate, and all users of application (browser) is a shared one. From the perspective of use, sharing the same 1 variables will cause a conflict of resource contention. (Most of the time you don't have to application)

3. The session server is saved by default of only a few minutes (can be modified), and application will persist until Tomcat off.

Similarities and differences between session and application in Java

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.