title: Cookie Overflow in Rails 4 even with memcachd server
body: <p>I'm converting a Rails 3 app, which used <code>active_record_store</code> for storing session information that was too large for regular cookies, to Rails 4, which has deprecated active_record_store. My Rails 4 app is raising the error...</p>
  
  <pre><code>ActionDispatch::Cookies::CookieOverflow (ActionDispatch::Cookies::CookieOverflow):
  </code></pre>
  
  <p>that caused me to switch to <code>active_record_store</code> in Rails 3. What can I do in Rails 4 if my session information exceeds the allowable limits?</p>
  
  <p>Update. I started the memcache server on my local machine and configured it like so in the development file</p>
  
  <pre><code>config.cache_store = :mem_cache_store, 'localhost', '127.0.0.1:11211',
  {:namespace =&gt; 'myapp123'}
  </code></pre>
  
  <p>In the console, when I do Rails.cache, it shows this (followed by a lot of data)</p>
  
  <p>=> true</p>
  
  <pre><code>&gt;&gt; Rails.cache
  =&gt; #&lt;ActiveSupport::Cache::MemCacheStore:0x007f80ebe10500 @options={}, @data=#&lt;Dalli::Client:0x007f80ebe0fd08 @servers=["localhost:11211"]
  </code></pre>
  
  <p>However I'm getting the same error when I'm running the application</p>
  
  <pre><code>ActionDispatch::Cookies::CookieOverflow (ActionDispatch::Cookies::CookieOverflow):
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/cookies.rb:455:in `[]='
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/session/cookie_store.rb:109:in `set_cookie'
    rack (1.5.2) lib/rack/session/abstract/id.rb:350:in `commit_session'
    rack (1.5.2) lib/rack/session/abstract/id.rb:226:in `context'
    rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
    activerecord (4.0.0.rc2) lib/active_record/query_cache.rb:36:in `call'
    activerecord (4.0.0.rc2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
    activerecord (4.0.0.rc2) lib/active_record/migration.rb:369:in `call'
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
    activesupport (4.0.0.rc2) lib/active_support/callbacks.rb:373:in `_run__1963944942928963409__call__callbacks'
    activesupport (4.0.0.rc2) lib/active_support/callbacks.rb:80:in `run_callbacks'
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
    railties (4.0.0.rc2) lib/rails/rack/logger.rb:38:in `call_app'
    railties (4.0.0.rc2) lib/rails/rack/logger.rb:21:in `block in call'
    activesupport (4.0.0.rc2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
    activesupport (4.0.0.rc2) lib/active_support/tagged_logging.rb:25:in `tagged'
    activesupport (4.0.0.rc2) lib/active_support/tagged_logging.rb:67:in `tagged'
    railties (4.0.0.rc2) lib/rails/rack/logger.rb:21:in `call'
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
    rack (1.5.2) lib/rack/runtime.rb:17:in `call'
    activesupport (4.0.0.rc2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    actionpack (4.0.0.rc2) lib/action_dispatch/middleware/static.rb:64:in `call'
    railties (4.0.0.rc2) lib/rails/engine.rb:511:in `call'
    railties (4.0.0.rc2) lib/rails/application.rb:97:in `call'
    rack (1.5.2) lib/rack/lock.rb:17:in `call'
    rack (1.5.2) lib/rack/content_length.rb:14:in `call'
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
    /Users/mm/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
    /Users/mm/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
    /Users/mm/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
  </code></pre>