darragh_19954
Nov 14, 2007Nimbostratus
Can global variables be used to carry information between events?
I'd like to use a global variable set up in the RULE_INIT event to carry some client-specific conditional information between the HTTP_REQUEST and HTTP_RESPONSE events. Is this possibe>
Here is the pseudo-code:
when RULE_INIT {
set ::variable 0
}
when HTTP_REQUEST {
conditional
if { ... } {
set ::variable 1
} elseif { ... } {
set ::variable 2
} ...
}
when HTTP_RESPONSE {
switch $::variable {
1 { ... }
2 { ... }
3 { ... }
default { ... }
}
}
So if 2 clients make a request at the same time, and they each have different settings for this variable, will those client-specific settings be preserved when the HTTP_RESPONSE event is called for each?