{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/31378492","id":31378492,"diff_hunk":"@@ -803,6 +803,27 @@ Just like when creating a controller for a route, the order of the arguments of\n order of the arguments, Symfony will still pass the correct value to each\n variable.\n \n+Checking the Validity of a CSRF Token\n+-------------------------------------\n+\n+Sometimes you want to use CSRF protection in an action where you don't want to use a\n+Symfony form.\n+\n+If, for example, you're doing a DELETE action, you can use ``isCsrfTokenValid()``::\n+\n+    if ($this->isCsrfTokenValid('token_id', $submittedToken)) {\n+        // ... do something, like deleting an object\n+    }\n+\n+.. versionadded:: 2.6\n+    The ``isCsrfTokenValid()`` shortcut method was added in Symfony 2.6.","path":"book/controller.rst","position":17,"original_position":17,"commit_id":"af4ebaa72c27305bc77ea9c7fb702715e21d0e90","original_commit_id":"af4ebaa72c27305bc77ea9c7fb702715e21d0e90","user":{"login":"xabbuh","id":1957048,"avatar_url":"https://avatars.githubusercontent.com/u/1957048?v=3","gravatar_id":"","url":"https://api.github.com/users/xabbuh","html_url":"https://github.com/xabbuh","followers_url":"https://api.github.com/users/xabbuh/followers","following_url":"https://api.github.com/users/xabbuh/following{/other_user}","gists_url":"https://api.github.com/users/xabbuh/gists{/gist_id}","starred_url":"https://api.github.com/users/xabbuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xabbuh/subscriptions","organizations_url":"https://api.github.com/users/xabbuh/orgs","repos_url":"https://api.github.com/users/xabbuh/repos","events_url":"https://api.github.com/users/xabbuh/events{/privacy}","received_events_url":"https://api.github.com/users/xabbuh/received_events","type":"User","site_admin":false},"body":"We always use \"was introduced in\".","created_at":"2015-05-30T06:49:32Z","updated_at":"2015-05-30T06:49:32Z","html_url":"https://github.com/symfony/symfony-docs/pull/5325#discussion_r31378492","pull_request_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/5325","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/31378492"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/5325#discussion_r31378492"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/5325"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/5325","id":36394216,"html_url":"https://github.com/symfony/symfony-docs/pull/5325","diff_url":"https://github.com/symfony/symfony-docs/pull/5325.diff","patch_url":"https://github.com/symfony/symfony-docs/pull/5325.patch","issue_url":"https://api.github.com/repos/symfony/symfony-docs/issues/5325","number":5325,"state":"open","locked":false,"title":"4668 document isCsrfTokenValid","user":{"login":"snoek09","id":92196,"avatar_url":"https://avatars.githubusercontent.com/u/92196?v=3","gravatar_id":"","url":"https://api.github.com/users/snoek09","html_url":"https://github.com/snoek09","followers_url":"https://api.github.com/users/snoek09/followers","following_url":"https://api.github.com/users/snoek09/following{/other_user}","gists_url":"https://api.github.com/users/snoek09/gists{/gist_id}","starred_url":"https://api.github.com/users/snoek09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoek09/subscriptions","organizations_url":"https://api.github.com/users/snoek09/orgs","repos_url":"https://api.github.com/users/snoek09/repos","events_url":"https://api.github.com/users/snoek09/events{/privacy}","received_events_url":"https://api.github.com/users/snoek09/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Doc fix?      | yes\r\n| New docs?     | yes\r\n| Applies to    | 2.6\r\n| Fixed tickets | #4668","created_at":"2015-05-28T10:53:06Z","updated_at":"2015-05-30T06:49:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5abae7b331de77160d1fdec9d7800cdc985a9504","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/5325/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/5325/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/issues/5325/comments","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/af4ebaa72c27305bc77ea9c7fb702715e21d0e90","head":{"label":"snoek09:4668-document-is-csrf-token-valid","ref":"4668-document-is-csrf-token-valid","sha":"af4ebaa72c27305bc77ea9c7fb702715e21d0e90","user":{"login":"snoek09","id":92196,"avatar_url":"https://avatars.githubusercontent.com/u/92196?v=3","gravatar_id":"","url":"https://api.github.com/users/snoek09","html_url":"https://github.com/snoek09","followers_url":"https://api.github.com/users/snoek09/followers","following_url":"https://api.github.com/users/snoek09/following{/other_user}","gists_url":"https://api.github.com/users/snoek09/gists{/gist_id}","starred_url":"https://api.github.com/users/snoek09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoek09/subscriptions","organizations_url":"https://api.github.com/users/snoek09/orgs","repos_url":"https://api.github.com/users/snoek09/repos","events_url":"https://api.github.com/users/snoek09/events{/privacy}","received_events_url":"https://api.github.com/users/snoek09/received_events","type":"User","site_admin":false},"repo":{"id":27299173,"name":"symfony-docs","full_name":"snoek09/symfony-docs","owner":{"login":"snoek09","id":92196,"avatar_url":"https://avatars.githubusercontent.com/u/92196?v=3","gravatar_id":"","url":"https://api.github.com/users/snoek09","html_url":"https://github.com/snoek09","followers_url":"https://api.github.com/users/snoek09/followers","following_url":"https://api.github.com/users/snoek09/following{/other_user}","gists_url":"https://api.github.com/users/snoek09/gists{/gist_id}","starred_url":"https://api.github.com/users/snoek09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoek09/subscriptions","organizations_url":"https://api.github.com/users/snoek09/orgs","repos_url":"https://api.github.com/users/snoek09/repos","events_url":"https://api.github.com/users/snoek09/events{/privacy}","received_events_url":"https://api.github.com/users/snoek09/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/snoek09/symfony-docs","description":"The Symfony2 documentation","fork":true,"url":"https://api.github.com/repos/snoek09/symfony-docs","forks_url":"https://api.github.com/repos/snoek09/symfony-docs/forks","keys_url":"https://api.github.com/repos/snoek09/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snoek09/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snoek09/symfony-docs/teams","hooks_url":"https://api.github.com/repos/snoek09/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/snoek09/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/snoek09/symfony-docs/events","assignees_url":"https://api.github.com/repos/snoek09/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/snoek09/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/snoek09/symfony-docs/tags","blobs_url":"https://api.github.com/repos/snoek09/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snoek09/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snoek09/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/snoek09/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snoek09/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/snoek09/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/snoek09/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/snoek09/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/snoek09/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/snoek09/symfony-docs/subscription","commits_url":"https://api.github.com/repos/snoek09/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/snoek09/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/snoek09/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/snoek09/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/snoek09/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/snoek09/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snoek09/symfony-docs/merges","archive_url":"https://api.github.com/repos/snoek09/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snoek09/symfony-docs/downloads","issues_url":"https://api.github.com/repos/snoek09/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/snoek09/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/snoek09/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/snoek09/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snoek09/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/snoek09/symfony-docs/releases{/id}","created_at":"2014-11-29T10:46:56Z","updated_at":"2014-11-29T10:46:59Z","pushed_at":"2015-05-28T13:24:24Z","git_url":"git://github.com/snoek09/symfony-docs.git","ssh_url":"git@github.com:snoek09/symfony-docs.git","clone_url":"https://github.com/snoek09/symfony-docs.git","svn_url":"https://github.com/snoek09/symfony-docs","homepage":"http://symfony.com/doc/current/","size":29389,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:2.6","ref":"2.6","sha":"e9ef6a41cd379b7421c6167e46873a6e1d95549a","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":521583,"name":"symfony-docs","full_name":"symfony/symfony-docs","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony-docs","description":"The Symfony documentation","fork":false,"url":"https://api.github.com/repos/symfony/symfony-docs","forks_url":"https://api.github.com/repos/symfony/symfony-docs/forks","keys_url":"https://api.github.com/repos/symfony/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony-docs/teams","hooks_url":"https://api.github.com/repos/symfony/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony-docs/events","assignees_url":"https://api.github.com/repos/symfony/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony-docs/tags","blobs_url":"https://api.github.com/repos/symfony/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony-docs/subscription","commits_url":"https://api.github.com/repos/symfony/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony-docs/merges","archive_url":"https://api.github.com/repos/symfony/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony-docs/downloads","issues_url":"https://api.github.com/repos/symfony/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony-docs/releases{/id}","created_at":"2010-02-17T08:43:51Z","updated_at":"2015-05-29T19:54:19Z","pushed_at":"2015-05-30T06:03:07Z","git_url":"git://github.com/symfony/symfony-docs.git","ssh_url":"git@github.com:symfony/symfony-docs.git","clone_url":"https://github.com/symfony/symfony-docs.git","svn_url":"https://github.com/symfony/symfony-docs","homepage":"http://symfony.com/doc","size":63250,"stargazers_count":985,"watchers_count":985,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1870,"mirror_url":null,"open_issues_count":281,"forks":1870,"open_issues":281,"watchers":985,"default_branch":"2.7"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/5325"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/5325"},"issue":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/5325"},"comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/5325/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/5325/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/5325/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony-docs/statuses/af4ebaa72c27305bc77ea9c7fb702715e21d0e90"}}}}