SessionStores.woa
Title: SessionStore.woa
Entry Number:
Creation Date: March 7, 1997
Last Updated: March 7, 1997
Procedure Valid for Release: WebObjects 3.x
Keywords: WebObjects, Session Stores, WOSessionStore, State in Page, State in Cookies
Overview
The SessionStores example accompanies the "Managing State" chapter of the WebObjects Developer's Guide and exists to illustrate various techniques available to a WebObjects application for storing information on a per-session basis.
Note: This example lets you switch between state storage strategies while the application is running. This is not a design you should emulate in your applications---changing storage strategies mid-session can cause errors. For example, imagine an application that stores state in the page during the first half of a session and stores state in cookies for the second. Now suppose that the user backtracks from a page in the second half to one in the first and resubmits the page. The application's strategy and the actual storage mechanism won't match, and state will be lost.
Installation
Download the compressed version of the SessionStores.woa example (10k bytes).
| If you are running OpenStep, double-click the compressed file to decompress it (if your browser doesn't decompress it automatically). | |
| If you are running Windows NT, rename the downloaded file to SessionStores.tar.Z and unpack it by typing the following at a DOS prompt: |
| gunzip SessionStores.tar.Z gnutar xvf SessionStores.tar |
Move the resulting file SessionStores.woa to this location in your HTTP server's document root:
DocumentRoot/WebObjects/Examples/SessionStores.woa
Running the Example
Start the application manually by entering this command in a Terminal window (OpenStep) or at a DOS prompt (Windows):
| WODefaultApp -d PathToDocumentRoot Examples/SessionStores |
Now, using a browser you can connect to the example by opening this URL:
| http://hostname/cgi-bin/WebObjects/Examples/SessionStores |