Forum Discussion

Giri_Prasad_170's avatar
Giri_Prasad_170
Icon for Nimbostratus rankNimbostratus
Sep 17, 2014

Is there way achieve cookies persistence for web request and context id persistence for device(ipad/ipod) request

In our application, we got web traffic (browser) as well as mobile traffic (rest call) to the same port (Say 80).

 

For web traffic, we use cookie as persistence and for mobile traffic we use the contextId value in the REST service requests' header to logically tie stateless REST service calls into a single "context" and physically store that as ClientSession (a subclass of HttpSession) instance in a ClientSession map on the server. The value of contextId is used to lookup ClientSession on the server when a subsequent REST service call is made for the same context. This approach can be compared to how j_session_id works in Java servlets.

 

Both use HTTP transport, but the binding of REST services is done using contextId for requests originating from mobile/ipad device versus using j_session_id for the requests originating from browser(IE).

 

Is there way achieve cookies persistence for web request and context id persistence for device (ipad/ipod) request using irule something ? Let us know your input.

 

1 Reply

  • You can retrieve the User-Agent to match the client type ( possibly use a data group if there are many ) by using HTTP::header to extract the User-Agent header. Then assign either basic cookie persistence or use uie based on the JSESSIONID or whatever. Check this out for details of JSESSIONID persistence.