This is really killing me…I’m trying to do something simple here just check if a APM sid is valid in the the HTTP_REQUEST event that I had previously stored in a cookie. I know the session is valid, I see it in the gui and in the logs and this [ACCESS::session exists $sessionid] keeps evaluating to 0!! I’m running 10.2.4HF4 didnt see anything about this in the release notes. Support doesn’t really “support” iRules I have nowhere to turn…HELP!
thanks -s
Here is my simple simple basic childlike code:
when ACCESS_POLICY_COMPLETED {
set policy_result [ACCESS::policy result]
switch $policy_result {
"allow" {
setup cookie for successful authentication
set apmsession [ACCESS::session data get "session.user.sessionid"]
set apmsessionuser [ACCESS::session data get "session.logon.last.username"]
set apmlanding [ACCESS::session data get "session.server.landinguri"]
set ckvar [format "%s:%s" $apmsession $apmsessionuser]
set apmcookie [format "%s=%s ; path=/; " $ckname $ckvar]
ACCESS::respond 302 Location $apmlanding "Set-Cookie" $apmcookie
log local0. "cookie sent $apmcookie"
}
"deny" {
ACCESS::respond 401 content "Error: Failure in Authentication" Connection Close
log local0. "APM Policy Denied Access"
}
}
}
when HTTP_REQUEST {
if { [ HTTP::cookie exists $ckname ] } {
pull authenticated user from cookie
set httpcookie [HTTP::cookie value $ckname]
set httpcookievals [split $httpcookie ":"]
set sessionid [lindex $httpcookievals 0]
set sessionuser [lindex $httpcookievals 1]
table set $sessionid $sessionuser
log local0. "http cookie found-> $httpcookie"
log local0. "table session valid = [ACCESS::session exists $sessionid]"
if { ![ACCESS::session exists $sessionid] } {
do crap here..
}
}