Forum Discussion
Waiting room iRule
For Clarity, here is the iRule without comments;
when HTTP_REQUEST priority 1 {
set static::maxActiveClients "[class search -all -value datagroup_customer starts_with "max_active_clients"]"
set subtableName "sessionLimit"
set sessionCookieName "[class search -all -value datagroup_customer starts_with "session_cookie_prefix"]"
set holdingPage "[class search -all -value datagroup_customer starts_with "holding_page_url"]"
set need_cookie 0
if {[HTTP::cookie exists $sessionCookieName]} { set client_id [HTTP::cookie $sessionCookieName]
set sessiondata [table lookup -subtable $subtableName $client_id] if { $sessiondata != "" } {
return } }
set sessionCount [table keys -subtable $subtableName -count]
if {$sessionCount < $static::maxActiveClients} {
set need_cookie 1 set client_id [format "%08d" [expr { int(1000000000 * rand()) }]] set sessionValue [IP::client_addr]
table add -subtable $subtableName $client_id $sessionValue $static::sessionTimeout
} else {
HTTP::redirect $holdingPage } } when HTTP_RESPONSE priority 1 {
if {$need_cookie == 1} { HTTP::cookie insert name $sessionCookieName value $client_id path "/" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com