Maintaining State

Maintaining state means remembering information while the user moves from page to page within a Web site. With this information in hand, you can set user preferences, fill in default form values, track visit counts, and do many other things that make browsing easier for users and that give you more information about how your pages are used.

You can maintain state information in several ways:

  • Store it in cookies

  • Encode it in URL links

  • Send it in hidden form variables

  • Store it in variables in other frames

  • Store it on the Web server

Be aware, however, that some technical challenges regarding state maintenance can occur. While browsing a site, a user might suddenly zoom off to another Web site and return minutes, hours, or days later, ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 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.