Cookie named "_myapp_key" exceeds maximum size of 4096 bytes

Hello~
I don’t save too much in session.
Why am I getting this error?

I don’t know where to find a bug in my code.
can anyone give me a hint what make this error happens?

Do you have any plugs that are saving data into session? Something that records navigation history is a likely suspect. I think you’ll see the decoded contents of session if you inspect conn.

1 Like

I inspected conn and there are few session data.

:plug_session => %{
      "_csrf_token" => "xRRDIFQnA6x37Mor9s8YPQ==",
      "phonebook_id" => 17,
      "recipients_id" => 174,
      "user_id" => 54

Does conn.assigns value affect to this error?

No, assigns wouldn’t be included, only session objects.

are you storing error messages in your session for later display?

If so, could it be that the message you are saving is a stacktrace or something that is longer than what you imagine?