Forum Discussion

fgf_165674's avatar
fgf_165674
Icon for Nimbostratus rankNimbostratus
May 18, 2017

JSESSIONID persistence

Hello all,

 

In K7392: Overview of universal persistence, I see the next iRule in order to do persistence based on JSESSIONID:

 

when HTTP_RESPONSE { if { [HTTP::cookie exists "JSESSIONID"] } { persist add uie [HTTP::cookie "JSESSIONID"] } }

 

when HTTP_REQUEST { if { [HTTP::cookie exists "JSESSIONID"] } { persist uie [HTTP::cookie "JSESSIONID"] } }

 

My question is:

 

  • Could it be possible to configure persistence based on JSESSIONID using a 'Cookie Persistence Profile' with "Cookie Method = Cookie Hash" and "Cookie Name = JSESSIONID" ?

Thank you!

 

2 Replies

  • Your idea should work. However, most people utilize Universal persistence profile or iRule directly for JSession ID persistence.

     

  • Hi,

     

    Sure, both will work. For Cookie Hash you can pick any cookie returned by server (of course the one used for identifying user session is most appropriate) by specifying Cookie Name in persistence profile.

     

    Difference between UIE and Cookie hash is in what is used as persistence key ID:

     

    • Cookie Hash - hash of the value in specified cookie
    • UIE - actual value of specified cookie

    Question is if hashing has more performance hit that executing iRule - that I am curious about.

     

    In my opinion benefit of using UIE is that actual cookie value is used as persistence record ID. So it's a lot easier to match persistence record to actual client session it is used for - persistence record value will be identical as value of cookie generated by server and being returned by client.

     

    Of course in case of Cookie Hash you will still see cookie used for hash (as created by server) but it's value will not match value used as key for persistence record.

     

    Piotr