Introduction to the session in JSP

Source: Internet
Author: User
Tags sessions

Term session

In my experience, the term "session" is probably second only to transaction, and it is more interesting that transaction and session have the same meaning in some contexts.

Session, Chinese often translated as a conversation, its original meaning is the beginning and end of a series of actions/messages, such as phone calls from the pick up the phone to hang up the phone in the middle of a series of processes can be called a sessions. Sometimes we can see the words "during a browser session, ...", where the term "session" is used in its original meaning, refers to from a browser window open to the closure of this period ①. The most confusing is "the user (client) during one session" in such a sentence, it may refer to a series of actions by a user (typically a series of actions related to a specific purpose, such as a process of online shopping from login to checkout, sometimes referred to as a transaction) , however, it is sometimes possible to refer only to a single connection, or to a meaning ①, in which the difference can only be inferred from the context ②.

However, when the term session is associated with a network protocol, it also tends to imply "connection-oriented" and/or "maintain state" such two meanings, "connection-oriented" refers to the communication between the two parties before communication to establish a communication channel, such as telephone, until the other side of the telephone communication to start, In contrast to this is a letter, when you send the letter out of the time you can not confirm the correct address, communication channels may not be established, but for the sender, communication has begun. "Staying state" means that one side of the communication can associate a series of messages so that the messages can be interdependent, such as a waiter who can recognize the old customer again and remember that the last time the customer owed the store a dollar. Examples in this category are "one TCP session" or "one POP3 session" ③.

In the era of Web server booming, the semantics of session in the context of web development has a new extension, meaning refers to a class of solutions used to maintain state between client and server ④. Sometimes the session is also used to refer to the storage structure of this solution, such as "Save XXX in Session" ⑤. Because various languages for web development provide some support for this solution, in a particular language context, the session is also used to refer to the solution of the language, For example, often the Java provided javax.servlet.http.HttpSession abbreviation for Session⑥.

In view of this confusion is not changed, the use of the Word session in this article will have different meanings according to the context, please pay attention to distinguish.

In this article, use the Chinese "browser session" to express the meaning of ①, use the "sessional mechanism" to express the meaning of ④, use "sessions" to express the meaning of ⑤, use the specific "HttpSession" to express the meaning ⑥

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.