Skip to content

Commit 64b7e08

Browse files
committed
Document _csrf_token form field
1 parent 7bd297f commit 64b7e08

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

_posts/2015-03-17-security.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ Using this handler is straight-forward.
101101
ALL("/books.*", new CSRFHandler());
102102
```
103103

104-
**2.** Add a `${csrfToken}` hidden input value on all forms that are POSTed to this protected path expression
104+
**2.** Add a `_csrf_token` / `${csrfToken}` hidden input value on all forms that are POSTed to this protected path expression
105105

106106
```html
107107
<html>
108108
<body>
109109
<form method="post" action="/books/5/rename">
110-
<input type="hidden" value="${csrfToken}" name="csrfToken" >
110+
<input type="hidden" name="_csrf_token" value="${csrfToken}">
111111
<input placeholder="Enter a new book title" name="bookTitle">
112112
<input type="submit" value="Rename">
113113
</form>

_posts/2015-06-01-forms.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ date: 2015-06-01 10:11:42
66
order: 55
77
---
88

9+
### Reserved Form Field Names
10+
11+
The following field names are reserved for Pippo.
12+
13+
- `_method`
14+
- `_content`
15+
- `_content_type`
16+
- `_csrf_token`
17+
918
### Cross-Site Request Forgery (CSRF) Protection
1019

1120
See [Security](security.html).

0 commit comments

Comments
 (0)