Reset Search
 

 

Article

KB44615 - Session persistence class 'Monitor application cookie' does not include all the parameters as set in the backend cookie

« Go Back

Information

 
Last Modified Date10/23/2020 1:05 AM
Synopsis

Session persistence class 'Monitor application cookie' does not include all the parameters as set in the backend cookie


The 'Monitor application cookie' session persistence method directs a request to the same server node if it contains an application cookie. You need to specify the name of the application cookie you wish to monitor.

Application cookie session maps are stored in a client-side cookie, so all traffic managers in a cluster will send the same session to the same server node.

For instance, if the response from the backend node contains a cookie (e.g. PHPSESSIONID) that you are monitoring using the Monitor application cookie, vTM then adds another cookie based on the original cookie which starts with K-PHPSESSIONID-xxxx

Example:

Set-Cookie: PHPSESSIONID=98ec0822230f59f68bd7cccdb2ece8b7; Path=/; HttpOnly; Secure; SameSite=None; Max-Age=86400;
Set-Cookie: K-PHPSESSIONID-gpkldajd=CDC89F7650FF11712C3166EDAC43D03D; path=/; secure

The client receives both these cookies, the first one is set by the backend node, the second one is set by the vTM to choose the right backend node in the pool. The second cookie is not delivered to the backend node as it is only used for session persistence/stickiness.

Problem or Goal
The problem here is, as seen the above example, the vTM cookie doesn't include all the parameters as included in the original cookie such as HttpOnly and SameSite etc.
Cause

The workaround is to use Universal session persistence instead of Monitor application cookie. Universal session persistence uses data supplied to the pool by the 'connection.setPersistenceKey()' TrafficScript as a key to identify which session the request is in.

Rule session maps are shared by all traffic managers in a cluster, so requests received by different traffic managers will apply the same sessions.

To use this workaround, the vTM license needs to have support for 'universal' session persistence. You can verify this by clicking the System > Licenses > Features, and make sure 'universal' is listed in the Persistence types.

Example:
Persistence types supported are: asp,ip,j2ee,kipper,named,sardine,ssl,universal,x-zeus

The license also needs to have support for TrafficScript. Both 'Advanced' and 'Enterprise' licenses have support for TrafficScript functionality.

To implement the workaround,

1. Create a Request Rule and add the following line (replace the PHPSESSIONID with the actual cookie name)

connection.setPersistenceKey(http.getCookie("PHPSESSIONID"));
 

2. Then create a Response Rule with the following line;

connection.setPersistenceKey(http.getResponseCookie("PHPSESSIONID"));

Solution
Related Links
Attachment 1 
Created ByYousaf Shah

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255