Forum Discussion
Jason_LaRocque_
Nimbostratus
Jan 26, 2007Checking if cookie exists on HTTP_RESPONSE
Good Morning-
We're looking to remove Apache servers from our DMZ in favor of other technologies (not apache based). However, we do unique user tracking with MOD_TRACKING in apache that inserts a...
Leo_Katona_5507
Nimbostratus
Jan 28, 2007If I understood correctly, you want to set the cookie if it isn't found in the request received from the user. What you're actually doing is checking whether it is present in the response being sent back from the server, which, of course, it never is.
You should check for the existence of the cookie in the HTTP_REQUEST event, not HTTP_RESPONSE. What you want is most likely this:
when HTTP_REQUEST {
set isset [HTTP::cookie exists {trackcookie}]
}
when HTTP_RESPONSE {
if {$isset == 0} {
HTTP::cookie insert name {trackcookie} value "[IP::client_addr]-[clock seconds]" path {/} domain {.mydomain.com}
HTTP::cookie expires {trackcookie} 3000 relative
}
}
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