Forum Discussion
bedwards311_338
Nimbostratus
Jun 11, 2018iRule - create cookie and insert value of client FQDN
I am trying to create an iRule that will create a cookie on the client and insert the client FQDN and client IP address into the cookie. So far, the iRUle will insert the client IP address but I can't find how to insert the client FQDN. Any help would be appreciated. Thanks
when HTTP_RESPONSE {
Check if the cookie exists in request
if { not ( [HTTP::cookie exists "LBSRC"] ) } {
Change cookie's value
HTTP::cookie insert name "LBSRC" value [IP::client_addr] } }
- youssef1
Cumulonimbus
Hi,
try this:
when HTTP_REQUEST { set hostname [HTTP::host] set client_ip [IP::client_addr] set nocookie 1 if { [HTTP::cookie exists LBSRC] } { set nocookie 0 } } when HTTP_RESPONSE { if {$nocookie} { HTTP::cookie insert name LBSRC value "$hostname $client_ip" } }
Let me now if you need more details...
Regards
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