Forum Discussion
TFalk_342445
Nimbostratus
Apr 12, 2019Check session variable fails
My apologies, I'm sure this is something stupidly simple that I'm just missing but I've been banging my head on this for a little while and all tests fail so far. I want to check if a variable ha...
Yoann_Le_Corvi1
Cumulonimbus
Apr 12, 2019Hi
You can try this...
when ACCESS_SESSION_STARTED {
ACCESS::session data set session.custom.myvariable ""
}
when HTTP_REQUEST {
if { ! [ACCESS::session data get session.custom.myvariable] equals "" ] } {
log local0. "Detecting myvariable variable, not doing anything."
}
else {
set uri [string tolower [HTTP::uri]]
set clientcode [string range [URI::path "$uri/" 2 2] 1 end-1]
ACCESS::session data set session.custom.myvariable $clientcode
log local0. "NOT detecting myvariable variable"
log local0. "setting session variable to be $clientcode"
}
}
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
