3
4

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.

[Rails]ActionDispatch::Cookies::CookieOverflow 解決法

Posted at

起こったこと

Rails で 突然出るエラー。

ActionDispatch::Cookies::CookieOverflow

主な原因としては
session 変数に多くのデータを保持する場合、

flash など view 関連のhelper で Objectやtextなど多くの文字列
を渡している場合、
に出るよう。

(CookieStore: session 情報を全てsecret_key_baseで暗号化し、クライアント側のCookie に保持。)

example.rb
flash[:success] = User.inspect # こんな原因

解決法

flash などhelper に渡すデータを減らす。(session に入れているため)

また、
session storeを変更するなど。

参考

3
4
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
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?