Forum Discussion
pallocca_73085
Nov 14, 2011Nimbostratus
I am thinking reserved word for cookie name
I am trying to manipulate the expiration time of a cookie being sent from my web server (pretty sure its a session cokkie w/o an expriation time). However I am getting errors from the LTM.
the cookie name = PD-H-SESSION-ID
my irule =
when HTTP_RESPONSE {
if {[HTTP::cookie exists "PD-H-SESSION-ID"]} {
log local0. "I see PD-H-SESSION cookie"
HTTP::cookie expires PD-H-SESSION-ID 30 relative
}
}
my error in log =
irule-wildcard - Illegal argument (line 1) invoked from within "HTTP::cookie expires PD-H-SESSION-ID 30"
i tried double and single quotes for the cookie name
i tried using a variable to hold the cookie name
any ideas?
- hooleylistCirrostratusCan you try curly braces?
when HTTP_RESPONSE { if {[HTTP::cookie exists "PD-H-SESSION-ID"]} { log local0. "I see PD-H-SESSION cookie" HTTP::cookie expires {PD-H-SESSION-ID} 30 relative } }
- pallocca_73085NimbostratusTried them all
( )
[ ]
{ }
All with the same error =
- hooleylistCirrostratusI wonder if this is a bug in the version of LTM you're trying with HTTP::cookie expires. Which LTM version are you testing on?
when HTTP_RESPONSE { log local0. "Inserting PD-H-SESSION-ID" HTTP::cookie insert name "PD-H-SESSION-ID" value test path "/" if {[HTTP::cookie exists "PD-H-SESSION-ID"]} { log local0. "Set-Cookie (pre): [HTTP::header values Set-Cookie]" HTTP::cookie expires {PD-H-SESSION-ID} 30 relative log local0. "Set-Cookie (post): [HTTP::header values Set-Cookie]" } }
< HTTP_RESPONSE>: Inserting PD-H-SESSION-ID < HTTP_RESPONSE>: Set-Cookie (pre): {PD-H-SESSION-ID=test;path=/;} < HTTP_RESPONSE>: Set-Cookie (post): {PD-H-SESSION-ID=test;expires=Tue, 15-Nov-2011 03:10:02 GMT;path=/;}
- pallocca_73085Nimbostratus10.2.2 hf1
- nitassEmployeethis is mine.
[root@orchid:Active] config b version|grep -iA 1 version BIG-IP Version 10.2.2 852.0 Hotfix HF1 Edition [root@orchid:Active] config b virtual bar list virtual bar { snat automap pool foo destination 172.28.17.89:http ip protocol tcp rules myrule profiles { http {} tcp {} } } [root@orchid:Active] config b pool foo list pool foo { members 10.10.70.110:http {} } [root@orchid:Active] config b rule myrule list rule myrule { when HTTP_RESPONSE { if {[HTTP::cookie exists "PD-H-SESSION-ID"]} { log local0. "I see PD-H-SESSION cookie" HTTP::cookie expires PD-H-SESSION-ID 30 relative } } } [root@orchid:Active] config curl -I http://10.10.70.110 HTTP/1.1 200 OK Date: Mon, 14 Nov 2011 20:57:27 GMT Server: Apache/2.0.59 (rPath) Last-Modified: Sat, 11 Jun 2011 00:31:47 GMT ETag: "667a-67-cfb682c0" Accept-Ranges: bytes Content-Length: 103 Vary: Accept-Encoding Set-Cookie: PD-H-SESSION-ID=1234567890 Content-Type: text/html; charset=UTF-8 [root@orchid:Active] config curl -I http://172.28.17.89 HTTP/1.1 200 OK Date: Mon, 14 Nov 2011 20:57:34 GMT Server: Apache/2.0.59 (rPath) Last-Modified: Sat, 11 Jun 2011 00:31:47 GMT ETag: "667a-67-cfb682c0" Accept-Ranges: bytes Content-Length: 103 Vary: Accept-Encoding Set-Cookie: PD-H-SESSION-ID=1234567890;expires=Tue, 15-Nov-2011 05:57:41 GMT; Content-Type: text/html; charset=UTF-8 [root@orchid:Active] config cat /var/log/ltm Nov 15 13:57:11 local/tmm info tmm[4878]: Rule myrule : I see PD-H-SESSION cookie
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects