1
我使用csrf,它在safari和firefox中可以正常工作(可以顯示POST頁面),但在chrome中只能獲得TokenMismatchException?任何人都知道最新的問題?我試圖清除捕獲物,但仍保持不變。在Chrome瀏覽器上使用Laravel 4 tokenmismatch
routes.php文件
/*
| Unauthenticated group
*/
Route::group(array('before' => 'guest'), function(){
/*
| CSRF protection group
*/
Route::group(array('before' => 'csrf'), function(){
/*
| Create Account (POST)
*/
Route::post('/account/create', array(
'as' => 'account-create-post',
'uses' => '[email protected]'
));
});
/*
| Create Account (GET)
*/
Route::get('/account/create', array(
'as' => 'account-create',
'uses' => '[email protected]'
));
});
AccountController.php
<?php
class AccountController extends BaseController{
public function getCreate(){
return View::make('account.create');
}
public function postCreate(){
return 'Hello.';
}
}
create.blade.php
@extends('layouts.master')
@section('content')
<form action="{{ URL::route('account-create-post') }}" method="post">
<input type="submit" value="Create account">
{{ Form::token() }}
</form>
@stop
發生在我身上以及只在鉻上,尋找解決方案:( –
我只是我沒有在我的鉻中保留任何cookie ..所以會話令牌每次都改變 – keatwei