{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/12693","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/12693/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/12693/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/12693/events","html_url":"https://github.com/laravel/framework/issues/12693","id":139964294,"number":12693,"title":"Csrf token is regenerated in the session after several Ajax requests in a short time ","user":{"login":"netfox01","id":4972714,"avatar_url":"https://avatars.githubusercontent.com/u/4972714?v=3","gravatar_id":"","url":"https://api.github.com/users/netfox01","html_url":"https://github.com/netfox01","followers_url":"https://api.github.com/users/netfox01/followers","following_url":"https://api.github.com/users/netfox01/following{/other_user}","gists_url":"https://api.github.com/users/netfox01/gists{/gist_id}","starred_url":"https://api.github.com/users/netfox01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netfox01/subscriptions","organizations_url":"https://api.github.com/users/netfox01/orgs","repos_url":"https://api.github.com/users/netfox01/repos","events_url":"https://api.github.com/users/netfox01/events{/privacy}","received_events_url":"https://api.github.com/users/netfox01/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-10T17:54:23Z","updated_at":"2016-03-11T17:25:34Z","closed_at":"2016-03-11T14:04:11Z","body":"Hi,\r\ni'm working on a Laravel 5.1 app where the user can upload many images (one by one).\r\n\r\nthe problem i have is the token is regenerated in the session after uploading couple images via ajax,\r\nso the next image wont be uploaded because Laravel tries to compare the old csrf token (when i first opened new content form) with the new one regenerated in the session.\r\ni dug into Laravel files and i figured out that the token is being regenerated  by this function in\r\n`vendor/laravel/framework/src/illuminate/session/store.php` file :\r\n   ```php\r\npublic function start()\r\n    {\r\n        $this->loadSession();\r\n\r\n        if (! $this->has('_token')) {\r\n            $this->regenerateToken();\r\n        }\r\n\r\n        return $this->started = true;\r\n    }\r\n```\r\nhere is an example :\r\n\r\nclick the images for a full screen\r\n\r\n**test part 1**\r\n![img_ajax_upload](https://cloud.githubusercontent.com/assets/4972714/13666931/57a644ea-e6b4-11e5-864c-ff285721f5cf.gif)\r\n\r\n**test part 2**\r\n![img_ajax_upload2](https://cloud.githubusercontent.com/assets/4972714/13666932/57b102a4-e6b4-11e5-9ad5-daf0817483ad.gif)\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/195465339","html_url":"https://github.com/laravel/framework/issues/12693#issuecomment-195465339","issue_url":"https://api.github.com/repos/laravel/framework/issues/12693","id":195465339,"user":{"login":"netfox01","id":4972714,"avatar_url":"https://avatars.githubusercontent.com/u/4972714?v=3","gravatar_id":"","url":"https://api.github.com/users/netfox01","html_url":"https://github.com/netfox01","followers_url":"https://api.github.com/users/netfox01/followers","following_url":"https://api.github.com/users/netfox01/following{/other_user}","gists_url":"https://api.github.com/users/netfox01/gists{/gist_id}","starred_url":"https://api.github.com/users/netfox01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netfox01/subscriptions","organizations_url":"https://api.github.com/users/netfox01/orgs","repos_url":"https://api.github.com/users/netfox01/repos","events_url":"https://api.github.com/users/netfox01/events{/privacy}","received_events_url":"https://api.github.com/users/netfox01/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T17:25:34Z","updated_at":"2016-03-11T17:25:34Z","body":"Before i opened this issue i've googled it and i didn't find any convenient answer. just hacking ways.\r\nso if this issue is duplicated and SOLVED, plz i'd love to know"}}