Java Reference
In-Depth Information
Both methods work by causing the web browser to keep returning a session id to the
web server. This session id is a unique number that identifies this one user from the others.
The session id is usually stored in the database and maps the logged in user's session to the
identity of the user.
The first method that web sites commonly use to support sessions is the URL line. You
can easily attach a session id to a web site's URL line. This session id must be passed to any
page that the user will enter on the website.
The other common method to support sessions is to place the session id into a cookie.
By setting a cookie, the web server can easily identify who has sent the request. The web
browser will automatically set the cookie for future requests to the server. If the web server
requires cookies, your bot must send these cookies.
So far, all of the recipes we have examined in this topic have not used any client side
scripting. In the next two chapters, you will be introduced to ways that your bot can handle
client side scripting. Chapter 9 will show how to handle embedded Javascript on a web site.
Chapter 10 will show how to use AJAX, which is a specialized Javascript method that com-
bines XML and other technologies.
Search WWH ::




Custom Search