ActionDispatch::Cookies::CookieOverflow
环境: ruby 1.8.7, rails 3.2.7
?
rails默认使用cookies来存储session中的数据
但是cookies有大小限制,如果session中的数据超过了这个限制就会报错,overflow溢出了
?
在config/initializers/session_store.rb中,将最后一句放开,设置session的存储方式为使用数据库
?
ChartTest::Application.config.session_store :cookie_store, :key => '_ChartTest_session'# Use the database for sessions instead of the cookie-based default,# which shouldn't be used to store highly confidential information# (create the session table with "rails generate session_migration") ChartTest::Application.config.session_store :active_record_store
?
然后执行:rails generate session_migration 创建session的迁移任务
再执行: ? rake db:migrate
?
最后重启服务器就好了
?