Topic
  • 5 replies
  • Latest Post - ‏2013-04-29T10:08:20Z by Rubita
Rubita
Rubita
4 Posts

Pinned topic How to do Cookie translation and Cookie persistence feature in DataPower?

‏2013-04-22T14:56:09Z |
  • Rubita
    Rubita
    4 Posts

    Re: How to do Cookie translation and Cookie persistence feature in DataPower?

    ‏2013-04-22T15:04:33Z  

    Hi,

    DataPower is used as Reverse Proxy in our architecture. The cookie which is generated at the backend server is based on domain my.test.ibm should be translated to the cookie expected by the mobile application (which is in domain my.CommB.test.com). Can this be solved by AO (Application Optimization) feature which has the ILD feature to support session affinity. It monitors the backend server cookie and inserts a cookie based on a domain and path.

    Would like to know can this be done programmatically as we don't have the AO license. Any thought on this?

    Regards,

    Rubita Swain

    Updated on 2013-04-22T15:04:49Z at 2013-04-22T15:04:49Z by Rubita
  • kenhygh
    kenhygh
    1522 Posts

    Re: How to do Cookie translation and Cookie persistence feature in DataPower?

    ‏2013-04-22T15:29:49Z  
    • Rubita
    • ‏2013-04-22T15:04:33Z

    Hi,

    DataPower is used as Reverse Proxy in our architecture. The cookie which is generated at the backend server is based on domain my.test.ibm should be translated to the cookie expected by the mobile application (which is in domain my.CommB.test.com). Can this be solved by AO (Application Optimization) feature which has the ILD feature to support session affinity. It monitors the backend server cookie and inserts a cookie based on a domain and path.

    Would like to know can this be done programmatically as we don't have the AO license. Any thought on this?

    Regards,

    Rubita Swain

    Rubita,

    The backend generates a cookie and you want to change it? A cookie is just a header, you can do whatever you want to it with the extension elements & functions.

     

    Ken

  • Rubita
    Rubita
    4 Posts

    Re: How to do Cookie translation and Cookie persistence feature in DataPower?

    ‏2013-04-23T05:20:49Z  
    • kenhygh
    • ‏2013-04-22T15:29:49Z

    Rubita,

    The backend generates a cookie and you want to change it? A cookie is just a header, you can do whatever you want to it with the extension elements & functions.

     

    Ken

    Hi Ken,

    I am aware of the DP extension function to set cookie and also append cookie value. But not sure how to generate a cookie based on a given domain name & path. Is there any DP extension function to do that. Since AO feature supports this, it can be do able but may be the DP extension function is not exposed.

    Any help on this will be highly appreciated.

    Regards,

    Rubita Swain

    Updated on 2013-04-23T05:21:03Z at 2013-04-23T05:21:03Z by Rubita
  • tjsmith
    tjsmith
    6 Posts

    Re: How to do Cookie translation and Cookie persistence feature in DataPower?

    ‏2013-04-23T12:10:58Z  
    • Rubita
    • ‏2013-04-22T15:04:33Z

    Hi,

    DataPower is used as Reverse Proxy in our architecture. The cookie which is generated at the backend server is based on domain my.test.ibm should be translated to the cookie expected by the mobile application (which is in domain my.CommB.test.com). Can this be solved by AO (Application Optimization) feature which has the ILD feature to support session affinity. It monitors the backend server cookie and inserts a cookie based on a domain and path.

    Would like to know can this be done programmatically as we don't have the AO license. Any thought on this?

    Regards,

    Rubita Swain

    Hi Rubita,

    The AO feature supports 'active' and 'active-conditional' session affinity support.  For 'active-conditional', DataPower monitors the "Set-Cookie" on the response from the back end.  It compares the Set-Cookie to a list of monitored cookies.   If it finds a match, then it inserts its own Set-Cookie with the configured cookie name, domain and path.   Note that it does not look at all at the existing domain and path associated with the cookie from the back end.  It only looks at the cookie name for comparison to find a match.

    There is no programming interface to access the session-affinity capabilities whether or not you have the AO features installed.

    If you do need to translate the cookie based on domain and path, I think Ken's suggestion is correct.   You would need to pull the header and overwrite it.

  • Rubita
    Rubita
    4 Posts

    Re: How to do Cookie translation and Cookie persistence feature in DataPower?

    ‏2013-04-29T10:08:20Z  
    • tjsmith
    • ‏2013-04-23T12:10:58Z

    Hi Rubita,

    The AO feature supports 'active' and 'active-conditional' session affinity support.  For 'active-conditional', DataPower monitors the "Set-Cookie" on the response from the back end.  It compares the Set-Cookie to a list of monitored cookies.   If it finds a match, then it inserts its own Set-Cookie with the configured cookie name, domain and path.   Note that it does not look at all at the existing domain and path associated with the cookie from the back end.  It only looks at the cookie name for comparison to find a match.

    There is no programming interface to access the session-affinity capabilities whether or not you have the AO features installed.

    If you do need to translate the cookie based on domain and path, I think Ken's suggestion is correct.   You would need to pull the header and overwrite it.

    Hi,

    Thanks for all your response. We are able to do Cookie translation using dp extension functions and setting it in HTTP Set-Cookie header. We are not persisting the cookie in DP, just appending both backend and DP generated cookie in the HTTP response message.

    Thanks,

    Rubita Swain