Search code examples
ruby-on-railsrubycookiesdevise

session_store.rb cookie key change doesn't change cookie name


In my rails app I tried changing cookie key like this

Rails.application.config.session_store :cookie_store, key: '_test_session', domain: :all

But when I check browser cookie, key name is still _session_id

enter image description here

Anyone know why key name doesn't change to _test_session?

I am using Rails 5.2.4 & Ruby 2.6.3


Solution

  • The issue was rails_admin gem I am using in my application.

    https://github.com/sferik/rails_admin/pull/3006 this PR in rails_admin gem hardcode session_store to cookie based. So even though I changed to cache_store from session_store.rb it was be overridden