Skip to content

Massive Cookie Size Leads to Errors #718

Closed
@alfmatos

Description

@alfmatos

I'm using a devise_token_auth rails api backend with a ng-token-auth angular frontend. I had to activate cookies in order to support ActiveAdmin, using the config below in application.rb

config.middleware.use ActionDispatch::Session::CookieStore
config.session_store :cookie_store

However, as soon as I turn this on, I see massive cookies (well over the 4kb limit) that throw:

ActionDispatch::Cookies::CookieOverflow (ActionDispatch::Cookies::CookieOverflow):

As a workaround, I've added replaced the store with active-record_store to keep session information in active record:

config.middleware.use ActionDispatch::Session::ActiveRecordStore
config.session_store :active_record_store

But the cookies and session data in the store continue to grow. If I reload the angular app (browser refresh, I see cookies several kb's long. If I trigger a fast double reload, I loose the current token and the session size increases.

Any ideas on how to make devise_token_auth play together with CookieStore?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions