Top

Managing State

One of WebObjects major benefits as a framework for commercial websites is its seamless handling and storage of per-user data. This chapter describes WebObject's state management system, showing you how it works and how to use it to your greatest advantage.

Table of Contents

Introduction
When Do You Need to Store State?
Objects and State
The Application Object and Application State
The Session Object and Session State
Component Objects and Component State

State Management and the Request-Response Loop
First Contact: A New Session
Accessing an Existing Session

State Storage Strategies
Comparison of Storage Options
A Closer Look at Storage Strategies
State in the Server
State in the Page
State in Cookies
Custom State Storage Options
Storing State for Custom Objects
Using EOEditingContext to Archive Custom Objects
Using the NSCoding Protocol to Archive Custom Objects

Controlling Session State
Creating and Accessing Session State
Managing Session Resources
Setting Session Time-out
Using awake and sleep

Controlling Component State
Creating and Accessing Component State
Managing Component Resources
Adjusting the Page Cache Size
Using awake and sleep
pageWithName: and Page Caching
Client-Side Page Caching
Page Refresh and WODisplayGroup

First Section