The following configuration shows how to share a session and reuse the session cookie container between two activities.
In this scenario, Cora SeQuence sends two calls to a service. The first call gets an authentication token and the second call performs the action.
You need to set up one HTTP Consumer that captures the returned token (cookie) and then pushes it to a second HTTP Consumer, which sends additional calls to get the data.
NOTE
The following procedures show only the settings relevant for reusing cookies between activities.
For more details on setting up HTTP Service activities, see this article.
Setting up the HTTP Consumer that captures the token
- On the HTTP Consumer Details screen, click Advanced Options.

- Set the type of the
HttpMessageHandlernode to webRequestHandler.

- Set
UseCookiesto True.

- Set the value of
InstanceModeto "PerSession".

- In the HTTP Consumer Bindings screen, clear the IsNull checkbox for the following nodes:
HttpRequestMessageSessionOptions
- Depending on the persistence mode, configure one of the following options for the session
Id:- Default mode: Set it to the workflow instance ID as string
- InMemory mode: Set it to a variable with a predefined random value. For example,
Guid.NewGuid().ToString("N")
- Change
SessionCloseBehaviorto "KeepOpen".
Setting up the HTTP Consumer that accesses the data
- On the HTTP Consumer Bindings screen, select the clear the
HttpRequestMessagenode, and clear the IsNull checkbox.

- Select the
SessionOptionsnode, and clear the IsNull checkbox.

- Set the SessionOptions properties, as follows:
- Session
Id: workflow instance ID as string SessionOpenBehavior: "Reuse"SessionCloseBehavior: "Close"
- Session
NOTE
The session ID must match the session ID of the first HTTP Consumer.







