Forum Discussion

JFC_377076's avatar
JFC_377076
Icon for Altocumulus rankAltocumulus
Feb 13, 2019

Irule to modify timeouts ?

Hi!

 

in a webportal configuration, i would like to modify the inactivity timeout and the maxsession timeout based on the IP source of the client.

 

datagroup= my ip address for the test

 

When CLIENT_ACCEPTED if { not [class match [IP::client_addre] equal datagroup } { ACCESS::session data set session.max_session_timeout 200 } else {ACCESS::session data set session.max_session_timeout 300 } }

 

I put this irule on the VS but each time no matters of the Ip source address of the client, the max session is always on the number fixed in the ACCESS POLICY PROFILE..

 

  • Use the iRule code inside ACCESS_SESSION_STARTED event not CLIENT_ACCEPTED:

     

    when ACCESS_SESSION_STARTED {
        set user_ip [ACCESS::session data get "session.user.clientip"]
        if { not [class match $user_ip equal datagroup } {
            ACCESS::session data set session.max_session_timeout 200
        } else {
            ACCESS::session data set session.max_session_timeout 300            
        }        
    }
  • hi! works like a charm ! thank you very much to correct my mistake.