Start session manually by code

By default, the user session is automatically created when the application starts; and the session includes no token. For the session to include the token, the session must be started manually by code instead of automatically.

To start the session manually by code,

Step 1: Select the "Dynamic session parameters" option in the PowerBuilder IDE. (Steps: Open the application object painter, click Additional Properties in the application's Properties dialog; in the Application dialog, select the PowerServer tab and then select the Dynamic session parameters option and click Apply.)

Step 2: Call the BeginSession function in the application Open event (See step 4 in "Add scripts").

After the "Dynamic session parameters" option is enabled, when the BeginSession function is called, it will create a session that includes the token information.