# Webcenter Cookie persistence

**URL:** <https://community.f5.com/t/webcenter-cookie-persistence/45046>\
**Category:** Technical Forums\
**Tags:** deployment, irules, big-ip-access-policy-manager-apm, oracle, devops, security, ltm, application-delivery\
**Created:** [May 28, 2014, 10:05am UTC](https://community.f5.com/t/webcenter-cookie-persistence/45046 "2014-05-28T10:05:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_E\_Aguad](https://avatars.discourse-cdn.com/v4/letter/j/3e96dc/32.png) [@Javier\_E\_Aguad](https://community.f5.com/u/Javier_E_Aguad)\
**Post date:** [May 28, 2014, 10:05am UTC](https://community.f5.com/t/webcenter-cookie-persistence/45046/1 "2014-05-28T10:05:13Z")

</div>

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 {

```tcl
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 “” }{

```tcl
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

---

<div class="post-metadata">

**Author:** ![What\_Lies\_Bene1](https://avatars.discourse-cdn.com/v4/letter/w/59ef9b/32.png) [@What\_Lies\_Bene1](https://community.f5.com/u/What_Lies_Bene1)\
**Post date:** [May 28, 2014, 12:22pm UTC](https://community.f5.com/t/webcenter-cookie-persistence/45046/2 "2014-05-28T12:22:51Z")

</div>

I suspect this;

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

```

should be;

```tcl
persist add uie [HTTP::cookie value "F5test"]

```

---

<div class="post-metadata">

**Author:** ![nitass](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nitass/32/2270_2.png) [@nitass](https://community.f5.com/u/nitass)\
**Post date:** [May 28, 2014, 12:47pm UTC](https://community.f5.com/t/webcenter-cookie-persistence/45046/3 "2014-05-28T12:47:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![nitass](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nitass/32/2270_2.png) [@nitass](https://community.f5.com/u/nitass)\
**Post date:** [May 28, 2014, 12:49pm UTC](https://community.f5.com/t/webcenter-cookie-persistence/45046/4 "2014-05-28T12:49:00Z")

</div>

```tcl
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

```
