Forum Discussion

  • 
    Irule Cookie_IP_Persist {
       when HTTP_RESPONSE {
    
      set SessionId [HTTP::cookie ASP.NET_SessionId]:[IP::client_addr]
     
      if { [HTTP::cookie ASP.NET_SessionId] != "" }{ persist add uie $SessionId 1800 }
    
    }
    
    
    when HTTP_REQUEST {
    
      set SessionId [HTTP::cookie ASP.NET_SessionId]:[IP::client_addr]
     
      if { [HTTP::cookie ASP.NET_SessionId] != "" }{ persist uie $SessionId 1800 }
    
    }
    }
     

    if { [HTTP::cookie ASP.NET_SessionId] != "" }{ persist add uie $SessionId 1800 }

    >>> this checks if Cookie named "ASP.NET_SessionId" has value not empty , it adds persistence record using IP & Cookie

    if { [HTTP::cookie ASP.NET_SessionId] != "" }{ persist uie $SessionId 1800 }

    >>> thsi checks if if Cookie named "ASP.NET_SessionId" has value not empty , it persists based on SessionId value , but i think here we shouldnot put 1800 ( time out ) , am i right ?

  • I'm not sure why you'd want to configure persistence for both the REQUEST and RESPONSE events?
  • You got my point , i found it like that on many posts & want to understand it , below are examples :

     

     

    https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/52/aft/2161049/showtab/groupforums/Default.aspx2237284

     

     

    https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/aft/8098/asg/50/Default.aspx

     

     

    https://devcentral.f5.com/wiki/irules.ASP_SessionID_Persistence.ashx

     

     

  • I'm not sure but that's certainly what's suggested in all the posts. I think it has something to do with minimising persistence records but can't be sure. Anyone else?
  • With 'persist add' in HTTP_RESPONSE, you're saying you want to manually add a persistence record after the load balancing has already been done with the given token for X seconds. On the request, you're saying you want to look up an existing persistence record using the same token as the key. If a persistence record already exists, its timeout will be updated. If there isn't one, a new record will be added.

     

     

    When using L7 persistence, to ensure a new persistence record is followed when a request is re-load balanced in a client-side Keep-Alive connection, apply a OneConnect profile to the virtual server.

     

     

    Aaron