Forum Discussion

boneyard's avatar
Dec 11, 2013

APM already active session error when changing landing URI

for a customer we setup APM with several landing URI to take different routes through the access policy. but of course the users sometimes make the mistake to enter https://apm.domain.com instead of using the correct landing URI, https://apm.domain.com/uri1. they can't correct this within the same session because then they get the "Access policy evaluation is already in progress for your current session." error screen. only workaround is closing the browser, which is annoying.

i tried to solve this on that error screen, but that doesn't appear possible (in 11.2.1 and 11.4.0). so i created this iRule to solve it, perhaps it comes in handy for others.

this iRule works in 11.4:

when HTTP_REQUEST {

 set sid [ACCESS::session sid]
 switch -glob [HTTP::uri] {
   "/uri1*" -
   "/uri2*"   {
     if {$sid != ""} {
       log local0. "request for /uri* and active session, remove session and redirect"
       ACCESS::session remove
       HTTP::redirect [HTTP::uri]
       TCP::close
     }
   }
   default {
     log local0. "default"
     do nothing
   }
 }
}

this iRule works in 11.2.1, i needed to add the after 5000 and HTTP::collect as APM doesnt quickly enough kill the session:

when HTTP_REQUEST {

 set sid [ACCESS::session sid]
 switch -glob [HTTP::uri] {
   "/uri1*" -
   "/uri2*"   {
     if {$sid != ""} {
       log local0. "request for /uri* and active session, remove session and redirect"
       ACCESS::session remove
       HTTP::collect
       after 5000 {
         HTTP::redirect [HTTP::uri]
         TCP::close
       }
     }
   }
   default {
     log local0. "default"
     do nothing
   }
 }
}
  • Thanks for the Great iRule! How did you manage in logout page click here link to go back to correct landing URI?

     

    Regrads, MC

     

  • just via the customization, you can add links via the localization or with advanced directly in the html code. if you need more info let me know and i can show in more detail what i did.

     

  • yes i have found that was via the customization of logout page but i couldn't manage the html code. If you could share i would appreciate.

     

    Thanks Best Regards, MC

     

  • ah, that you can't do. unfortunately F5 doesnt give you acccess to any variables at the logout page.

     

    what i did was simply add something like when your in group x click this link, when your in group y click this link and so on. and then have the links point to the specific landing URIs. you cant get it to go back to where it came from dynamically.

     

    do you still need the code, it isn't that special. just basic html really.