Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
Chapter
his chapter shows you how to use the servlet session tracking API to
keep track of visitors as they move around at your site.
T
9.1 The Need for Session Tracking
HTTP is a stateless protocol: each time a client retrieves a Web page, it
opens a separate connection to the Web server, and the server does not auto
matically maintain contextual information about a client. Even with servers
that support persistent (keep alive) HTTP connections and keep a socket
open for multiple client requests that occur close together in time (see Sec
tion 7.4), there is no built in support for maintaining contextual information.
This lack of context causes a number of difficulties. For example, when cli
ents at an on line store add an item to their shopping carts, how does the
server know what's already in them? Similarly, when clients decide to proceed
to checkout, how can the server determine which previously created shop
ping carts are theirs?
There are three typical solutions to this problem: cookies, URL rewriting,
and hidden form fields.
199
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved