Murach's Java Servlets and JSP (2nd Edition)
How to work with sessions and cookies

This chapter shows how to use the servlet API to keep track of sessions and to work with cookies.

Chapter 8 How to work with sessions and cookies
An introduction to session tracking 244
Why session tracking is difficult with HTTP 244
How session tracking works in Java 244
An application that needs session tracking 246
How to work with sessions 248
How to set and get session attributes 248
More methods of the session object 250
How to enable or disable cookies 252
How to use URL encoding to track sessions without cookies 254
How to provide thread-safe access to the session object 256
How to work with cookies 258
An introduction to cookies 258
How to create and use cookies 260
How to view and delete cookies 262
Four methods for working with cookies 264
A utility class for working with cookies 266
How to work with URL rewriting and hidden fields 268
How to use URL rewriting to pass parameters 268
How to use hidden fields to pass parameters 270
The Download application 272
The user interface 272
The file structure 274
The web.xml file 274
The code for the JSPs and servlets 276
t




Murach's Java Servlets and JSP

Learn more about this book

View the table of contents

Add this book to your cart