The BIG-IP persistence cookie is a valuable configuration option that allows stateful applications to remain persistent to a specific node with no additional configurations within the application or on the server(s) by doing something like clustering.

I hear application development teams refer to this as “sticky session” or “stick sessions”, but in reality this cookie has nothing to do with a user’s “application” session, but has everything to do with the user’s session persistence to the same server that the application session was started on.

After reading an F5 Solution article (SOL6917: Overview of BIG-IP persistence cookie encoding) and learning that the information encoded within a BIG-IP Cookie could be useful I decided to make a tool that could decipher this information quickly so that I could use it for troubleshooting.

What is useful in a BIG-IP Cookie?

The BIG-IP Cookie contains the IP Address of the server that the client is being persisted to, as well as the server port that the connection is being established on.

So? Why is this useful? I could get that information from an iRule…

True, you can get this information logged within the LB::selected event within an iRule, but that requires you to make an iRule change to gather the information that you actually already have (unless you are encrypting your BIG-IP Cookies which negate the usefulness of this tool). Most changes in Production require change management approval, which you get to bypass when using this tool if cookie persistence is configured.

There are many tools that you can use to capture the persistence cookie being provided by the BIG-IP. I commonly use Fiddler2 (http://www.fiddler2.com/fiddler2/)…

 

tt_cookie_persistence_troubleshooting_1

 

This is the application that I created to decipher the BIG-IP Cookies.

 

tt_cookie_persistence_troubleshooting_2

 

The tool is semi-intelligent for the input. It can take any of the following and give the correct output:

BIGipServerpool.ltm.ve.gamezone.com=336202250.40475.0000
336202250.40475.0000
336202250.40475

Paste the cookie into the tool and select ‘Auto-Parse’ option:

 

tt_cookie_persistence_troubleshooting_3

 

This will populate the Conversion Area:

 

tt_cookie_persistence_troubleshooting_4

 

Then select the ‘Decipher’ option:

 

tt_cookie_persistence_troubleshooting_5

 

This becomes useful for troubleshooting purposes to determine which server you are persisted to when you are trying to determine which member server is or is not having an issue.

As you can see, this correctly identified which server I was communicating with in this pool of servers:

 

tt_cookie_persistence_troubleshooting_6

 

I hope that everyone finds this tool useful.

If you find any issues or have any questions please feel free to contact me on DevCentral.

Source Code

The full source for this application can be retrieved at this link: CookietoolRelease.zip

Comments on this Article
Comment made 08-Aug-2011 by Jacob 1
Does this tool handle the cookie format changes when using route domains?
0
Comment made 10-Aug-2011 by Michael Yates 735
Unfortunately No. It was only designed to decipher the default (IPv4) persistence cookie.

There is no reason why you couldn't add to it though using the information provided in the overview of the Persistence Cookie.

SOL6917: Overview of BIG-IP persistence cookie encoding
http://support.f5.com/kb/en-us/solutions/public/6000/900/sol6917.html?sr=15957282
0
Comment made 13-Oct-2016 by dasz 0

For some reason it cannot decipher valid cookie: BIGipServerP80_pool1=185860362.20480.0000

0
Comment made 24-Nov-2016 by keshav 251

Its seems you have missed one digit while decoding that. Please check and tried one more time it will work for you also.

i used same value which you provided in the comments

You mentioned BIGipServerP80_pool1=185860362.20480.0000

Added another digit BIGipServerP80_pool1=1858603621.20480.0000 IP address 101.10.200.10 Port 80

0
Comment made 5 months ago by pr@teeku1988 71

Working fine for me thanks for sharing this tool

0