Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mention that flash and redirect_to are often used together
  • Loading branch information
kraih committed Aug 29, 2014
1 parent 06b6efe commit ea35fb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Mojolicious/Guides/Growing.pod
Expand Up @@ -377,8 +377,9 @@ set an absolute expiration date in the past.
$c->session(expires => 1);

For data that should only be visible on the next request, like a confirmation
message after a 302 redirect, you can use the flash, accessible through the
method L<Mojolicious::Controller/"flash">.
message after a 302 redirect performed with
L<Mojolicious::Controller/"redirect_to">, you can use the flash, accessible
through the method L<Mojolicious::Controller/"flash">.

$c->flash(message => 'Everything is fine.');
$c->redirect_to('goodbye');
Expand Down
4 changes: 4 additions & 0 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -826,6 +826,10 @@ L<Mojolicious::Validator::Validation/"error">.
</body>
</html>

The methods L<Mojolicious::Controller/"flash"> and
L<Mojolicious::Controller/"redirect_to"> are often used together to prevent
double form submission.

=head2 Cross-site request forgery

CSRF is a very common attack on web applications that trick your logged in
Expand Down

0 comments on commit ea35fb6

Please sign in to comment.