• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Maintaining State Information

Chapter 11. Maintaining State Information

Imagine that you cannot form memories and that your thoughts and experiences vanish once they leave your conscious mind. To be able to function from day to day, you'd need to record information immediately in order to recall anything later. You might even go so far as the main character in the film Memento who took Polaroid pictures of the people he met and tattooed critical information all over himself.

A Web server is a lot like a person who can't form memories. When you request a page from a Web server, it focuses its resources on retrieving the page (if the page is static) or generating the page (if the page is dynamic) and then sends the finished page to your browser. After it sends the finished page on its way, the server then promptly forgets everything that went into the creation and delivery of the page. From a performance standpoint, it makes sense for the server to “clear the decks” and have all its resources available for the next request it receives. Unfortunately, this also creates challenges for you as a developer. For example, any form data submitted to the server as part of a request for a page will be lost after the page is generated. If you need that form data at some later point in the user's visit to your site, you will have to store it when it is initially submitted to you. If you don't capture the data at that point, it will be lost when the server does its “brain dump.”


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint