Js|session on a classic website, visitors can browse several Web pages and perform some interactive behavior. If you are writing such a website, it is very useful to use some data from each user. For this purpose, we can use the "sessions" in the JSP.
Session is a user-related object. When a user visits a Web site, some data is stored in the session and extracted from the data when needed. The session saves different data for different users.
The following page places the user's name in the session and can display it elsewhere. First we're going to make a form and then name it getname.html
<HTML>
<BODY>
<FORM METHOD=POST ACTION="SaveName.jsp">
What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20>
If you open two different browsers, or run two browsers from two different machines, you can place a name in one browser and a different name in the other browser, but two names will be tracked. The session remains tracked until it times out, and it assumes that the user has not visited the site, so it is canceled.
Finally, decorate this tutorial with the link: Use session, in the above example to add a user's "age" attribute.
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.