Forum Discussion

Shyam_Shukla's avatar
Shyam_Shukla
Icon for Nimbostratus rankNimbostratus
Nov 16, 2019

Retrieve all active session for an user from iRule code

Hello All,

 

Is there any way to retrieve all active session for an user from iRule code. For e.g., an user has logged in from two different browser then F5 would have two different session ids.

In https://clouddocs.f5.com/api/irules/ACCESS__session.html link, I don't see any option to returns all active sessions for an user

2 Replies

  • have a look this link:

    hen HTTP_REQUEST {
        set apm_cookie_list [ ACCESS::uuid getsid "[PROFILE::access name].[HTTP::username]" ]
        log local0. "[PROFILE::access name].[HTTP::username] => session number [llength $apm_cookie_list]"
        for {set i 0} {$i < [llength $apm_cookie_list]} {incr i} {
            log local0. "MRHSession => [ lindex $apm_cookie_list $i]"
        }
    }
     
    Jan 24 19<!--:36:03 local/tmm info tmm[23333]: Rule _test <HTTP_REQUEST>: simpleAD_withSSO.domain\lie => session number 1-->
    Jan 24 19<!--:36:03 local/tmm info tmm[23333]: Rule _sys_APM_activesync <HTTP_REQUEST>: MRHSession => 51539106083c66c3926e3305d60addae-->
     
  • that irule wont do what the original question asker is looking for. to be honest there doesn't appear to be something like that.

     

    in theory you could cycle to all possible session IDs, but that wont work in practice im afraid. if there is no way to list all sesion or search based on other keys you are out of luck.