JSP status management, jsp status

Source: Internet
Author: User

JSP status management, jsp status

1. Stateless http protocol

Stateless means that when a browser sends a request to the server, the server responds to the client request. But when the same browser sends a request to the server again, the server does not know that it is the browser just now. Simply put, the server won't remember you, so it is a stateless protocol.

2. Two mechanisms for saving the user status

Cookie and Session Technologies

3. Cookie Introduction

Cookie: a series of text information stored on the client by the Web server.

Typical application: Determine whether a registered user has logged on to the website. Processing of the shopping cart.

Cookie: Tracking specific objects to save users' web browsing records and habits simplify logon security risks: easy to leak user privacy information.

4. Create and use cookies

For more information about cookies and sessions, see the Cookie and Session section in Servlet-core Foundation of JavaWeb technology and the cornerstone of JavaWeb framework (II.

5. Session and Cookie comparison

In common: all are used to save the user status; all expire sessions: the user information is saved on the server, and the Object type is saved. the stored data is destroyed as the Session ends, save important information.
Cookie: stores user information on the client, which is of the String type. It can be stored on the client for a long time to save unimportant user information.

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.