Forum Discussion

Harishwar_Reddy's avatar
Harishwar_Reddy
Icon for Nimbostratus rankNimbostratus
Jul 20, 2015

Previously i am using persistence as cookie, and this has removed and set to none. Is there any way to 'clear' the persistence for clients with exist

Previously i am using persistence as cookie, and this has removed and set to none. Is there any way to 'clear' the persistence for clients with exisisting cookies ?

 

4 Replies

  • Hi Hari,

    There is two option to clear persistence record. virtual server & node level.

    tmsh delete ltm persistence persist-records virtual my-virtual   --> VIP
    

    If you want to delete to a the presistance for a single node, you can use command.

    tmsh delete ltm persistence persist-records pool node-addr node-port  --> node
    
    • Samir_Jha_52506's avatar
      Samir_Jha_52506
      Icon for Noctilucent rankNoctilucent
      Is there any way to 'clear' the persistence for clients with existing cookies ? --No, You should delete persistence record through VIP.
  • There may be a little confusion about your question.

    If you're talking about using cookies to persist load balanced traffic, then there's nothing you really have to do once you disable it since all of the persistence information is stored within the cookie itself. There won't be a persistence table entry if using cookies.

    If you're talking about using a persistent (ie. file-based) cookie for load balancing persistence, and though you've removed this persistence profile there are still clients with this cookie, then you can absolutely use an iRule to catch that. Something like this:

    when HTTP_REQUEST {
        set foundit 0
    
        foreach x [HTTP::cookie names] {
            if { $x starts_with "BIGipServerlocal" } {
                set foundit $x
                HTTP::cookie remove $x
            }
        }
    }
    when HTTP_RESPONSE {
        if { ( [info exists foundit] ) and $foundit != 0 } {
            HTTP::cookie insert name $foundit value "null" path "/"
            HTTP::cookie expires $foundit 0 absolute
        }
    }
    

    In this example I'm looking for a cookie that starts with "BIGipServerlocal". If it's found, the HTTP_REQUEST event removes it from the ingress stream so that load balancing persistence doesn't happen based on that cookie, and then sets a flag. In the HTTP_RESPONSE event, if the flag exists (the name of the cookie), a new cookie with the same name is sent to the client, but with an expires header that forces the client to delete the cookie.