Mecha CMS

Guard::token()

Generate unique token and save it to session.

2.0.0Static

Guard::token($id = 0, int $for = 60);
Guard::token($id = 0, string $for = '1 minute');

Example:

<input name="token" type="hidden" value="<?= Guard::token(); ?>">