Visual Basic Concepts
State Management in IIS Applications
Typically, Internet applications are stateless, in that the protocol that passes requests and responses between the browser and Web server is not capable of maintaining information between each request. Therefore, the protocol does not "remember" any information from previous requests when it receives a new request.
Because the protocol itself cannot maintain state, you must use other means to store information you want the application to remember between requests. There are several ways you can store state for a Web-based application:
Use the WebClass object or other objects on the server to store state information between client requests.
Use a database to store state information between requests.
Move state information back and forth between the server and the browser on each request, using , the URLData property, or hidden HTML fields.
Note You can use a combination of these methods. For example, you might store information in a database and use cookies to send the database keys to the client.
Each approach has its own advantages and disadvantages. Storing state in objects is easy, but it may affect the scalability of your applications because the server must keep the object instantiated across requests and locate the same object each time it makes a subsequent request. Using databases is more scalable, but requires you to manage connections and recordsets. Moving state back and forth between client and server allows you to avoid storing information in either location but does increase the bandwidth of each request, has capacity limitations, and is potentially less secure.