Table of Contents Previous Section

First Contact: A New Session

A user first contacts a WebObjects application by directing a browser to open a location with a URL of this type (using the CyberWind example for illustration):

http://localhost/cgi-bin/WebObjects/Examples/CyberWind

When the WebObjects application receives this request (in the application objects's handleRequest: method), the application object searches the request URL for a session identifier. Since this is the first request, the URL doesn't include this identifier and so the application creates a new session by sending itself a createSession message.

The next step is to find the requested page. Pages are normally accessed through the session object, but since this is a new session it doesn't yet have any pages. So, the application creates a new component for the page called "Main". (Remember, if no page is specified in the request, WebObjects assumes a page name of "Main".)

From this point on, the request processing proceeds as described in the last chapter, with the page taking values from the request, invoking an action method, and finally returning a response page to the application.

The application object saves the response page in the session object and then saves the session object in the application-wide session store (an object of the WOSessionStore class). You'll learn more about the session store in "State Storage Strategies" below, but for now it's sufficient to know that a session store is a repository for the application's session objects when they are not actively engaged in request-response loop processing. Finally, the application returns to the client the HTTP response generated by the response page.

Table of Contents Next Section