BOTDEFENSE::captcha_age

Description

Returns the age of the CAPTCHA challenge in seconds. This is only relevant if the value of BOTDEFENSE::captcha_status is “correct”; otherwise, -1 is returned.
Syntax
BOTDEFENSE::captcha_age

Warning

Deprecated in BIG-IP Next v20.0.1


Syntax

BOTDEFENSE::captcha_age

BOTDEFENSE::captcha_age

Return Value

Returns the age of the CAPTCHA challenge in seconds, or -1 if not applicable.

Valid During

BOTDEFENSE_ACTION

Examples

# EXAMPLE: Send CAPTCHA challenge and validate the response, but to avoid
 # blocking requests to which CAPTCHA challenge cannot be sent (non-HTML pages),
 # send the CAPTCHA challenge on HTML pages after 30 seconds of aging, which is
 # before the expiration of the answer.
 when BOTDEFENSE_ACTION {
     if {[BOTDEFENSE::action] eq "allow"} {
         if {[BOTDEFENSE::captcha_status] eq "correct"} {
             if {    ([BOTDEFENSE::cs_allowed]) &&
                     ([BOTDEFENSE::captcha_age] >= 30)} {
                 BOTDEFENSE::action captcha_challenge
             }
         } else {
             if {[BOTDEFENSE::action captcha_challenge] ne "ok"} {
                 if {[BOTDEFENSE::action custom_response {
                     login failed because you may not be human
                 }] ne "ok"} {
                     BOTDEFENSE::action tcp_rst
                 }
             }
         }
     }
 }

Change Log

  • Introduced: 12.1
  • Deprecated: 20.0.1

The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.