# CSRF object

# csrf.token

Returns the token to be sent on forms to avoid CSRF attacks.

Example:

    <form method="POST" action="/profile">
        <input type="hidden" name="_token" value="{{ csrf.token }}">
        ...
    </form>

Will return:

    <form method="POST" action="/profile">
        <input type="hidden" name="_token" value="lxqZd2I1aGlzorJbLeAzhytnLvMBquOvbGYJoOCx">
        ...
    </form>

# csrf.field

Returns the HTML input element with the CSRF token ready to be used inside a HTML form element.

Example:

    <form method="POST" action="/profile">
        {{ csrf.field }}
        ...
    </form>

Will return:

    <form method="POST" action="/profile">
        <input type="hidden" name="_token" value="lxqZd2I1aGlzorJbLeAzhytnLvMBquOvbGYJoOCx">
        ...
    </form>