HTML::FormHandler::Field::RequestToken(3pm)

HTML::FormHandler::Field::RequestToken3pm

Hidden text field which contains a unique time-stamped token

Usage

    with 'HTML::FormHandler::Field::Role::RequestToken';
    ...
    has_field '_token' => (
        type => 'RequestToken',
    );

Version

version 0.40068

Overview

This field is for preventing CSRF attacks. It contains an encrypted token containing an expiration time for the form. No data needs to be persisted in the user's session or on the server.

Attributes

expiration_time

Length of time (in seconds) that token will be accepted as valid from the time it is initially generated. Defaults to 3600.

token_prefix

An optional string to prepend to the token value before encrypting it. If specified, any received tokens must begin with this value to be accepted as valid. Defaults to an empty string.

Passed on form process. "$c->sessionid . '|'"

crypto_key

Key to use to encrypt/decrypt the token payload.

crypto_cipher_type

The "Crypt::CBC" cipher to use to encrypt/decrypt the token payload. Defaults to "Blowfish".

message

Error message if token is missing/invalid.

cipher

A "Crypt::CBC" object to handle encrypting/decrypting the token payload. If not specified, "crypto_key" and "crypto_cipher_type" will be used to construct one.

verify_token

Validates whether the specified token is currently valid for this form.

get_token

Generates a new token and returns it.

Releases

4 releases since Debian 10 (Buster); the text changed 1 time.

  1. 10–11
  2. 12–13

Author

FormHandler Contributors - see HTML::FormHandler

From libhtml-formhandler-perl 0.40068-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.