I have a very weird problem, when storing my session in Memcached. From time to time some users takes the session of others. E.g. John, becomes logged in as Maria, Maria as
Here it is the code that resolves the problem for me:
I added these lines at the end of
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
CACHE.reset
if Rails.cache.class == ActiveSupport::Cache::MemCacheStore
Rails.cache.instance_variable_get(:@data).reset
end
end
end
end