2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laravel 「The page has expired due to inactivity.」の非常に稀な解決法

Last updated at Posted at 2020-12-16

何が起きているか

最初に言っておきます。
CSRF はフォームにちゃんと入っていて設定も出来ています。
よくある入れ忘れ、設定漏れではありません。
結構、悩みました。

ログインをすると、必ず1回は以下が表示されます。

「The page has expired due to inactivity.
Please refresh and try again.」

もう一度ログインを実行すると、目当てのページへ遷移します。


結論

このケースは非常に稀な気がしますす…。
検証環境は Laravel 5.6 です。

・これが間違い ↓

<form method="POST"

・こうしたらちゃんとログイン出来ました…。

<form method="post"

自分も、ここだけ大文字にしてしまった理由が分からないのですが…
(他の画面では要素はすべて小文字で書いているのに…)
そこですか、と…。

こんなミスをする人も、まずいないのだろうなと思いますが…。

同じように CSRF の設定かと思って延々、悩まれている方が、
広い世界にはいるかも知れないと思い、ここに記録を残しておきます…。


おねがい

詳しいことが分かる方がいらっしゃいましたら、解説をお願い致します…。


2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?