JSP Tutorials - Herong's Tutorial Examples - v5.11, by Herong Yang
What Is a Session
This section describes what is a session - a concept to represent a series of HTTP requests and responses exchanged between a specific Web browser and a specific Web server.
What Is a Session?: Session is a concept to represent a series of HTTP requests and responses exchanged between a specific Web browser and a specific Web server, as illustrated in the following diagram:
Server Browser ID created | <-- Request #1 --- | | --- Response #1 --> | ID kept as cookie | <-- Request #2 --- | ID send back to server | --- Response #2 --> | | <-- Request #3 --- | ID send back to server | --- Response #3 --> | | ...... |
The session concept is managed by the server. When the first request comes from a browser on a new host, the server makes the beginning of a new session, and assigns a new session ID. The session ID will be then sent to the browser as cookie. The browser will remember this ID, and send the ID back to the server in the subsequent requests. When the server receives a request with session ID in them, it knows this is a continuation of an existing session.
When the server receives a request from a browser on a new host (request without a session ID), the server not only creates a new session ID, it also creates a new session object associated with the session ID. See the next tutorial for details.
If there is no subsequent request coming back for a long time for a particular session ID, that session will be timed out. After the session has been timed out, if the browser comes back again with the associated session ID, the server will give an invalid session error.
Table of Contents
JSP (JavaServer Pages) Overview
Tomcat Installation on Windows Systems
Syntax of JSP Pages and JSP Documents
Passing Values between JSP Pages
Testing Result of RegForm.jspx
Using Perl LWP Package for Debugging
JavaBean Objects and "useBean" Action Elements
Managing HTTP Response Header Lines
Non-ASCII Characters Support in JSP Pages
Overview of JSTL (JSP Standard Tag Libraries)
Multiple Tags Working Together
Using Tomcat on CentOS Systems
Connecting to SQL Server from Servlet