8.15 The RandomModularSessionFileApp Class

The RandomModularSessionFileApp class is intended for use in applications which define page code in a collection of Python modules which are randomly accessed via the URI in the browser request. Session state is stored in the file system at the server.

Figure: The RandomModularSessionFileApp class
 
\includegraphics[]{randmodsessfileapp}

The RandomModularSessionFileApp class defines the following methods:

__init__( base_url, page_path, start_page, secret, session_appid, session_dir)
When you inherit from the RandomModularSessionFileApp 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 page_path argument defines the root directory where page modules and template files are loaded from. The start_page identifies the page that will be served up when a page identifier cannot be determined from the URI in the browser request. 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_dir argument defines the directory in which the application will store session files.

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