1.11.5 Multiple Applications and Stores

Once the session is successfully loaded we can create a store object.

The web.session module supports using multiple applications within an environment. Each application has its own session store and can only access values in its own store to avoid the risk of over-writing another application's data. This has the benefit of allowing applications to share the same session ID and cookie.

Application names can be a string made up of the characters a-z, A-Z, 0-9 and -_.. The application name must be between 1 and 255 characters in length. The application names do not have to be the same as application names used by the web.auth module, although these are the most appropriate choices.

It is important you choose a name for your application which is unique in the environment you are using. For example if you are also using the web.auth module you should not use the application name 'auth' since the web.auth module used the application name 'auth' to store its values.

To access a store using the store() method of the manager object you must specify an application name, for example:

store = manager.store('testApp')