VerifyCsrfToken

Cross-site request forgeries are a type of malicious exploit whereby

unauthorized commands are performed on behalf of the authenticated

user.

Allowing users to submit your form from an iframe on a different

domain is exactly the kind of thing Laravels CSRF protection is trying

to prevent.

There is a way to disable CSRF verification for certain URL's. You can add a new item to the$exceptarray to exclude that url from CSRF verification.

Http/Middleware/VerifyCsrfToken.php


namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

class VerifyCsrfToken extends BaseVerifier

{

/**

* The URIs that should be excluded from CSRF verification.

*

* @var array

*/

protected $except = [

'your/uri'

];

}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,043評(píng)論 0 23
  • 終于到家了,佟月月大口喘氣。 拖著疲憊的身體開門進(jìn)屋反鎖,包隨便往沙發(fā)一甩,直接倒在沙發(fā)上。由于自己租的房子,倒也...
    研橙閱讀 308評(píng)論 0 0
  • 沙漠的夕陽,灑在如玉般潔白的墻壁上。 整個(gè)清真寺,霎那間從神圣的潔白變換成了耀眼的金黃。 你說,不知道該怎么辦,只...
    Barlcky閱讀 224評(píng)論 0 0
  • 昨天一放學(xué)我和媽媽便搭了紅巖車回家。 回家干嘛呢?好多人會(huì)問。 咋天是我表姐的奶奶90歲生日,因?yàn)槲液蛬寢尯镁脹]回...
    六中六7班童佳文閱讀 357評(píng)論 4 9
  • 淺院藏進(jìn)幾分秋 吹落滿枝紅豆愁 備下薄酒約明月 扶醉同守小閣樓
    洛子風(fēng)閱讀 1,322評(píng)論 0 1

友情鏈接更多精彩內(nèi)容