Forum Discussion

navgup_66025's avatar
navgup_66025
Icon for Nimbostratus rankNimbostratus
Jul 22, 2013

Env variable or session variable

declare global var =0

 

when HTTP_REQUEST {

 

if var = 0 {

 

if { [HTTP::header value Authorization] contains "Negotiate YII" } {

 

var = 1

 

pool Kerberos_Pool

 

} else {

 

var = 2

 

pool Forms_Pool

 

}

 

}

 

}

 

Is there a way to declare a global session var that does not reset until the session is closed?

 

There are many REQUESTS that goes in a client initial logon authorization session.

 

 

 

However, since there are many REQUESTs in the same session, the browser jumps from kerberos pool to forms pool (back and forth) because form pool sometimes return null. Is there a way to set a global variable in irule that keep a count for a number of a request went through? For eg, how many times [HTTP::header value Authorization] contains "Negotiate YII" HTTP REQUEST went through?

 

1 Reply

  • Unfortunately, global variables are actually global to the box. In your case I'd try setting the initial "var" variable in the CLIENT_ACCEPTED event. Local variables essentially last for the span of a TCP session, so setting it here makes it available to all other events within that TCP session.

     

     

    Alternatively, if you need the value to span multiple TCP sessions, you may need to explore setting the value in the session table.