Maintaining state means keeping track of all the information your application needs to know about a specific user, either during a single session or between multiple sessions. Examples of the kinds of information you may need to know are:
•
What is the user's name?
•
Has the user signed on?
•
Has the user seen the previous page?
•
Has the user properly filled out a form at some previous stage?
•
Is the user waiting for a response from the application?
Longer term, you might want to be able to answer more complex questions, such as:
•
Has this user purchased any other product like <this> from us during the past year?
•
Which pages in the application has this user never seen? How might you best route them there?
In essence, maintaining state is the process of associating information with a specific user. This is the biggest single problem you're likely to have with your Web applications, and how you solve it depends, or should depend, on several factors:
•
The number of users you expect to access your application simultaneously
•
The size and speed of your server
•
The efficiency of your pages
•
The amount of information you need to store to maintain state for a single user
In this chapter, I'll show you several options for maintaining state in WebClass applications and discuss the advantages and disadvantages of each.