We just rolled out an update to our app which switched to mem_cache_store for sessions. Immediately, all posts to forms threw an ActionController::InvalidAuthenticityToken exception. I understand that there was a problem with this in 2.3.9, but we're on 2.3.10.
The config change in production.rb is:
require_library_or_gem 'memcache'
config.action_controller.session_store = :mem_cache_store
config.action_controller.session = {
:secure => true,
:cache => MemCache.new('our.memcache.host', :name开发者_如何学Pythonspace => 'rack:session')
}
Am I doing something wrong?
You need to rename the session key whenever you move the session store to prevent ActionController::InvalidAuthenticityToken errors.
精彩评论