Forum Discussion
Kenji_Matsuura_
Nimbostratus
Oct 24, 2014iRule to insert cookie when there is external site cookie on the APM
Hi,all
I've created a iRule such as the following.
Check wheter there is "SMSESSION" Cookie. If there is "SMSESSION" Cookie, Insert the same Cookie at the time of the Portal Access.
It...
kunjan_118660
Cumulonimbus
Oct 24, 2014Not sure why the error, may be can try replace instead and also some logging to see what so unique here:
when REWRITE_REQUEST_DONE {
log local0. "Request URI = [HTTP::uri]"
foreach x [HTTP::header names] {
log local0. "Request header($x) = [HTTP::header $x]"
}
HTTP::header replace "Cookie" "SMSESSION=10"
}
Kenji_Matsuura_
Nimbostratus
Oct 25, 2014Unfortunately, the error still occured.
Error is as follows.
*Such as IP Address is different from the actual.
(100.100.100.100 is APM, 200.200.200.200 is target of Portal Access)
In addition, because the Cookie other than SMSESSION to use, "Cookie replace" is not available.
I think that there is a bug in the "REWRITE_REQUEST_DONE".
Is there any other way?
---------------------------------------------------------------------------------------------------------------
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request URI = /xxx.js?AAAAAAAAAA
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(Accept) = */*
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(Accept-Language) = ja-JP,en;q=0.7,zh-CN;q=0.3
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(Referer) = https://test/xxx
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(User-Agent) = Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2;
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(Host) = test
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(Connection) = Keep-Alive
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(session-id) = 00891ef2
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(session-key) = f842ca4f07d174e8c147b28300891ef2
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(username) = testuser
Oct 25 19:28:08 apm info tmm[9526]: Rule /Common/test : Request header(Cookie) = SMSESSION=KRE0kMe1hYqqxTIKL366D9T3Qb9wEsvR5nc9b0gwQCSH8O
Oct 25 19:28:08 apm err tmm[9526]: 01220001:3: TCL error: /Common/test - Illegal argument. Can't execute in the current context. (line 1) invoked from within "HTTP::uri"
Oct 25 19:28:08 apm err tmm[9526]: 01230140:3: RST sent from 100.100.100.100:22629 to 200.200.200.200, [0x1897b4b:1290] {peer} iRule execution error
Oct 25 19:28:08 apm err tmm[9526]: 01230140:3: RST sent from 100.100.100.100:22629 to 200.200.200.200, [0x1892ed2:1379] TCP 3WHS rejected
Oct 25 19:28:08 apm err tmm[9526]: 01230140:3: RST sent from 100.100.100.100:22629 to 200.200.200.200, [0x1892ed2:1379] TCP 3WHS rejected
---------------------------------------------------------------------------------------------------------------
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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