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'

];

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,394评论 0 23
  • 终于到家了,佟月月大口喘气。 拖着疲惫的身体开门进屋反锁,包随便往沙发一甩,直接倒在沙发上。由于自己租的房子,倒也...
    研橙阅读 1,794评论 0 0
  • 沙漠的夕阳,洒在如玉般洁白的墙壁上。 整个清真寺,霎那间从神圣的洁白变换成了耀眼的金黄。 你说,不知道该怎么办,只...
    Barlcky阅读 1,378评论 0 0
  • 昨天一放学我和妈妈便搭了红岩车回家。 回家干嘛呢?好多人会问。 咋天是我表姐的奶奶90岁生日,因为我和妈妈好久没回...
    六中六7班童佳文阅读 2,206评论 4 9
  • 浅院藏进几分秋 吹落满枝红豆愁 备下薄酒约明月 扶醉同守小阁楼
    洛子风阅读 5,022评论 0 1