Forum Discussion

Javier_E__Aguad's avatar
Javier_E__Aguad
Icon for Nimbostratus rankNimbostratus
May 28, 2014

Webcenter Cookie persistence

Hello,

I have some problems when implementing cookie persistence for an Oracle WebCenter pool . The problem is that when i add persistence using an irule, the value is not mantained and the persistence fails.

I have writed this irule to troubleshoot the problem. Please, any clue if is possible to enhance the solution? Or i have any mistake on the writed fields.

when HTTP_REQUEST priority 300 {

if { [HTTP::cookie "F5test"] ne "" } { 

    pool "p_evo_wl" 

    persist uie [HTTP::cookie "F5test"]

    if {[HTTP::cookie "F5test"] starts_with "f5id_"}{

         HTTP::cookie remove "F5test"

    }


} else {

    pool "p_evo_wl"

}  

}

when HTTP_RESPONSE {

if { [HTTP::cookie "F5test"] eq "" }{

   set rndumb "f5id_[expr { int(100000000 * rand()) }]" 


   HTTP::cookie insert name "F5test" value $rndumb"

   persist add uie $rndumb 14400 


} else {

   persist add uie [HTTP::cookie "F5test"]

}

}

Many thanks in advance!

Javier

  • I suspect this;

    persist add uie [HTTP::cookie "F5test"]
    

    should be;

    persist add uie [HTTP::cookie value "F5test"]
    
  • The problem is that when i add persistence using an irule, the value is not mantained and the persistence fails.

     

    i do see client sending cookie back to virtual server in the next request. persistence record seems to be created properly.

     

    by the way, why do you have to change cookie value on every response?

     

  •  1st request
    
    [root@ve11a:Active:In Sync] config  ssldump -Aed -nni 0.0 port 80
    New TCP connection 1: 192.168.206.174(65089) - 172.28.24.10(80)
    1401280870.9567 (0.0075)  C>S
    ---------------------------------------------------------------
    GET / HTTP/1.1
    Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    Accept-Language: en-US
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; MS-RTC LM 8; .NET4.0E)
    Accept-Encoding: gzip, deflate
    Host: 172.28.24.10
    Connection: Keep-Alive
    
    ---------------------------------------------------------------
    
    New TCP connection 2: 200.200.200.14(65089) - 200.200.200.101(80)
    1401280870.9589 (0.0019)  C>S
    ---------------------------------------------------------------
    GET / HTTP/1.1
    Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    Accept-Language: en-US
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; MS-RTC LM 8; .NET4.0E)
    Accept-Encoding: gzip, deflate
    Host: 172.28.24.10
    Connection: Keep-Alive
    
    ---------------------------------------------------------------
    
    1401280871.0251 (0.0662)  S>C
    ---------------------------------------------------------------
    HTTP/1.1 200 OK
    Date: Wed, 28 May 2014 12:30:36 GMT
    Server: Apache/2.2.3 (CentOS)
    Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT
    ETag: "41879c-59-2a9c23c0"
    Accept-Ranges: bytes
    Content-Length: 89
    Keep-Alive: timeout=15, max=100
    Connection: Keep-Alive
    Content-Type: text/html; charset=UTF-8
    
    snipped
    ---------------------------------------------------------------
    
    1401280871.0264 (0.0697)  S>C
    ---------------------------------------------------------------
    HTTP/1.1 200 OK
    Date: Wed, 28 May 2014 12:30:36 GMT
    Server: Apache/2.2.3 (CentOS)
    Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT
    ETag: "41879c-59-2a9c23c0"
    Accept-Ranges: bytes
    Content-Length: 89
    Keep-Alive: timeout=15, max=100
    Connection: Keep-Alive
    Content-Type: text/html; charset=UTF-8
    Set-Cookie: F5test=f5id_42112601";
    
    snipped
    ---------------------------------------------------------------
    
     2nd request
    
    1401280871.1038 (0.0773)  C>S
    ---------------------------------------------------------------
    GET /f5.gif HTTP/1.1
    Accept: */*
    Referer: http://172.28.24.10/
    Accept-Language: en-US
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; MS-RTC LM 8; .NET4.0E)
    Accept-Encoding: gzip, deflate
    Host: 172.28.24.10
    Connection: Keep-Alive
    Cookie: F5test=f5id_42112601"
    
    ---------------------------------------------------------------
    
    1401280871.1040 (0.0788)  C>S
    ---------------------------------------------------------------
    GET /f5.gif HTTP/1.1
    Accept: */*
    Referer: http://172.28.24.10/
    Accept-Language: en-US
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; MS-RTC LM 8; .NET4.0E)
    Accept-Encoding: gzip, deflate
    Host: 172.28.24.10
    Connection: Keep-Alive
    
    ---------------------------------------------------------------
    
     persistence record
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) show ltm persistence persist-records
    Sys::Persistent Connections
    universal  f5id_86485162  172.28.24.10:80  200.200.200.101:80  (tmm: 0)
    universal  f5id_42112601  172.28.24.10:80  200.200.200.101:80  (tmm: 0)
    universal  f5id_86485162  172.28.24.10:80  200.200.200.101:80  (tmm: 1)
    universal  f5id_42112601  172.28.24.10:80  200.200.200.101:80  (tmm: 1)
    universal  f5id_56125535  172.28.24.10:80  200.200.200.101:80  (tmm: 1)
    Total records returned: 5