8.8 The SimpleSessionApp Class

The SimpleSessionApp class is intended for use in monolithic applications (page objects instead of page modules). Session state is stored at the server.

Figure: The SimpleSessionApp class
 
\includegraphics[]{simplesessapp}

The SimpleSessionApp class defines the following methods:

__init__( base_url, template_path, start_page, secret, session_appid [, session_server = 'localhost'][, server_port = 34343][, session_age = 1800])
When you inherit from the SimpleSessionApp class you must call this constructor.

The base_url argument is used as the base for URLs produced by the <al-a> and <al-form> tags. The template_path defines the root directory where template files are loaded from. The start_page identifies the first page that will be served up in a new browser session. The secret argument is used to MD5 sign all pickles sent to the browser.

The session_appid argument identifies the session application at the session server. Multiple applications can share sessions by using the same identifier here. The session_server argument defines the host where the session server is running, it defaults to localhost. The server_port defines the session server port, it defaults to 34343. The session_age argument defines the number of seconds that an idle session will be kept, it defaults to 1800.

create_context( )
Returns a new instance of the SessionAppContext class.