Forum Discussion
Feb 09, 2011
logging each cookie name failing in logs
Hello all, The below code is throwing an error in the logs: when HTTP_REQUEST { set cookies [HTTP::cookie names] foreach cookie $::cookies { log local0. "Cookie: $...
hooleylist
Feb 09, 2011Cirrostratus
Hi TRX,
Using a global variable ($::cookies) probably isn't what you want in this scenario as a global variable is shared across all connections. If you change $::cookies and $::cookie to $cookies and $::cookie to $cookie, the rule should work fine. You can also eliminate the intermediate variable, $cookies to save a little memory:
when HTTP_REQUEST {
Loop through each cookie by name
foreach cookie [HTTP::cookie names] {
Log the cookie name and value
log local0. "Cookie name: $cookie, Cookie value: [HTTP::cookie value $cookie]"
}
}
Aaron
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