Forum Discussion
Kai_Wilke
Nov 24, 2022MVP
Hi Sakiy,
I always use an iRule to fix APMs rather broken errorhandling if MRHSession cookies from previous APM sessions remain in browser. I believe you could use the very same iRule to fix your problems...
when HTTP_REQUEST {
# Fixing APMs complains when restart of APM sessions occur....
if { [HTTP::cookie value "MRHSession"] eq "" } then {
# APM cookie not present so we do nothing...
} elseif { [ACCESS::session exists -state_allow [HTTP::cookie value "MRHSession"]] } then {
# APM cookie present and already authenticated. Pass the cookie to APM...
} elseif { ( [HTTP::path] starts_with "/public/images/customization/" )
or ( [HTTP::path] starts_with "/saml/sp/profile/post/acs" ) } then {
# APM cookie present but not authenticated and requesting APM resources which are not hidden by APMs HUD filter. Do nothing...
} else {
# APM Cookie present but not authenticated. Killing existing APM session (if exists) and remove MRHSession cookie from the ongoing request...
ACCESS::session remove
HTTP::cookie remove "MRHSession"
}
}
The iRule simply removes inactive MRHSession cookies from those requests which are not hidden by APMs HUD Filter (aka. Request to APM itself).
Give it a try...
Cheers, Kai