1. 程式人生 > >Laravel框架post的路由出現The page has expired due to inactivity. Please refresh and try again.

Laravel框架post的路由出現The page has expired due to inactivity. Please refresh and try again.

post提交資料時候顯示如下:

The page has expired due to inactivity. 

Please refresh and try again

這是由於在laravel框架中有此要求:任何指向 web 中 POST, PUT 或 DELETE 路由的 HTML 表單請求都應該包含一個 CSRF 令牌,否則,這個請求將會被拒絕。

<form method="POST" action="/profile">
{{ csrf_field() }}
    ...
</form>