Java Web Session Management II: Sessions

Source: Internet
Author: User
Tags session id

First, Session

In web development, the server can create a session object for each yoghurt browser. Note: A browser is exclusive to a session object. Therefore, when the user data needs to be saved, the server program can write the user data to the user's browser exclusive session, when the user uses the browser to access other programs, the other program can remove the user data from the user's seesion and serve it

Ii. the difference between a session and a cookie

A cookie is a user's data addressed to a client

Session is to write the user's data to the user exclusive session

The session object is created by the server and the developer can invoke the GetSession method of the request object to get the Session object

Third, session realization principle

  • How does the server implement a session for a user browser service?

After the server creates the session, it will put the ID number of the session to the client in the form of a cookie, so that, as long as the client's browser does not close, and then to the azimuth server, will take the session ID number, the server discovers the client's session ID, It will use the corresponding session in memory to serve it.

Java Web Session Management II: Sessions

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.