Session Parameters
A session is the connection that the user makes with the server when viewing a mashup in a visualization. You can create session parameters to store temporary data from the current user session. For example, you can use a session parameter to store a setting for the preferred style theme for a mashup. The values of session parameters are unique for each user connected to the server, and they are stored until the session ends.
A session ends when a user closes the application, logs out using the Logout function, or times out after idling on the server. The default timeout period for a platform session is 30 minutes. You can configure the default timeout using the SetPlatformSessionTimeout administrator service. For more information, see Administrator Services.
To store data required for more than a single session, use a database or a Thing. The session parameter data is maintained when a user navigates between different mashups.
Adding Session Parameters
You can use a Thing Shape entity with one or more properties as session parameters. To add a Data Shape to the UserManagementSubsystem entity:
1. In Composer, click Browse.
2. Under SYSTEM, select Subsystems, then open the UserManagementSubsystem entity.
3. Add a Thing Shape to the subsystem in one of the following ways:
On the Services tab, execute the AddSessionShape service:
1. Locate the service and click Execute Service under the Execute column. The Execute Service dialog box opens.
2. In the name field, select the Thing Shape that contains the session parameters, then click Execute.
3. Click Done to close the dialog box.
4. Click Save to save the changes to the subsystem.
On the Configuration tab, under User Session Shape Settings, click Add. A dialog box opens.
1. Type a Thing Shape name and click Add.
2. Click Save to save your changes to the subsystem.
The Thing Shape is added to the subsystem. The properties of the Data Shape are listed as bindable session parameters when you open the Session panel.
Using an infotable with multiple rows and columns as a session parameter may reduce performance.
For more information, see User Management Subsystem.
Accessing Session Parameters on the Platform Server
To retrieve the session parameter values:
1. In Composer, click Browse.
2. Under System, select Resources, then open the CurrentSessionInfo resource entity.
3. On the Services tab, execute the GetGlobalSessionValues service:
a. Locate the service on the list, then under the Execute column, click Execute Service. The Execute Service dialog box opens.
b. Click Execute . The parameter values for the current session are displayed on the Output pane.
c. Click Done to close the dialog box.
The available session parameters are listed on the Session panel. You can bind session parameters to functions, services, or widgets.
Was this helpful?