1HTML::FormFu::Element::URseeqrueCsotnTtorkiebnu(t3e)d PeHrTlMLD:o:cFuomremnFtua:t:iEolnement::RequestToken(3)
2
3
4
6 HTML::FormFu::Element::RequestToken
7
9 version 2.04
10
12 my $e = $form->element( { type => 'Token' } );
13
14 my $p = $form->element( { plugin => 'Token' } );
15
17 This field can prevent CSRF attacks. It contains a random token. After
18 submission the token is checked with the token which is stored in the
19 session of the current user. See "request_token_enable" in
20 Catalyst::Controller::HTML::FormFu for a convenient way how to use it.
21
23 HTML::FormFu::Element::RequestToken - Hidden text field which contains
24 a unique token
25
27 context
28 Value of the stash key for the Catalyst context object ($c). Defaults
29 to "context".
30
31 expiration_time
32 Time to life for a token in seconds. Defaults to 3600.
33
34 session_key
35 Session key which is used to store the tokens. Defaults to "__token".
36
37 limit
38 Limit the number of tokens which are kept in the session. Defaults to
39 20.
40
41 constraints
42 Defaults to HTML::FormFu::Constraint::RequestToken and
43 HTML::FormFu::Constraint::Required.
44
45 message
46 Set the error message.
47
49 expire_token
50 This method looks in the session for expired tokens and removes them.
51
52 get_token
53 Generates a new token and stores it in the stash.
54
55 verify_token
56 Checks whether a given token is already in the session. Returns 1 if it
57 exists, 0 otherwise.
58
60 Catalyst::Controller::HTML::FormFu, HTML::FormFu::Plugin::RequestToken,
61 HTML::FormFu::Constraint::RequestToken
62
63 HTML::FormFu
64
66 Moritz Onken, "onken@houseofdesign.de"
67
69 This library is free software, you can redistribute it and/or modify it
70 under the same terms as Perl itself.
71
73 • Carl Franks <cpan@fireartist.com>
74
75 • Nigel Metheringham <nigelm@cpan.org>
76
77 • Dean Hamstead <dean@bytefoundry.com.au>
78
80 This software is copyright (c) 2007-2018 by Carl Franks / Nigel
81 Metheringham / Dean Hamstead.
82
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85
86
87
88perl v5.34.0 2021-07H-T2M2L::FormFu::Element::RequestToken(3)