Forum Discussion

Deb_Allen_18's avatar
Deb_Allen_18
Historic F5 Account
Mar 16, 2006

Cookie persistence value in session table

 

We're using cookie persistence.

 

We need to keep track of the total number of concurrent sessions.

 

 

It seems like a good way would be to push the persistence cookie value into the session table (with a timeout for automatic purging of the table of idle connections), use the session table to determine whether inbound requests belong to a current session, then count the relevant records in the table to determine the number of concurrent active sessions.

 

 

After reading everything I could find about session & HTTP::cookie & HTTP::header, I have some questions:

 

 

1) Can I extract the persistence cookie value after LTM sets it in the outbound response? I'm assuming I can just look for a set-Cookie header with the right cookie name, but it would have to be after the persistence cookie gets written by LTM. What event would that be? (I'm sure we could calculate the cookie value in LB_SELECTED, or even simple, just insert another cookie just for this purpose, as in many of the other connection counting rules, but it would be nice to use what's already there...)

 

 

2) I need to count the number of records in the session table that were explicitly added by this rule. Do I need to add a field indicating the source of the record to do so? What is the command to count records (filtered as necessary)?

 

 

thanks!

 

/deb

 

1 Reply

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Well, to answer your questions:

     

     

    1. Yes, you should be able to read the value of the persistence cookie after it's set.

     

     

    Try looking in the HTTP_REQUEST_SEND or HTTP_REQUEST_DATA events.

     

     

    2. Yes, you would need to add some form of identifier to the entry so that you could grab only those set by this rule and count them...which would all have to be done manually :-/

     

     

     

    When you say you're tracking concurrent sessions...do you mean actual sessions, or merely concurrent connections? If you're just trying to limit concurrent user connections, there are likely easier ways. Click here

     

     

    -Colin