Chapter 9. Session Tracking

Topics in This Chapter

  • Implementing session tracking from scratch

  • Using basic session tracking

  • Understanding the session-tracking API

  • Differentiating between server and browser sessions

  • Encoding URLs

  • Storing immutable objects vs. storing mutable objects

  • Tracking user access counts

  • Accumulating user purchases

  • Implementing a shopping cart

  • Building an online store

This chapter introduces the servlet session-tracking API, which keeps track of user-specific data as visitors move around your site.

The Need for Session Tracking

HTTP is a “stateless” protocol: each time a client retrieves a Web page, the client opens a separate connection to the Web server and the server does not automatically maintain contextual information about the client. ...

Get Core Servlets and JavaServer Pages™: Volume 1: Core Technologies, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.