In the end, I used Redis as a session repository.
gem 'redis-rails'
and specify it in the session storage type:
AppEx::Application.config.session_store :redis_store,
Then I can use Memcached as a clean cache and clear it without affecting the user login status.
This is also good because when using Memcached, users exit the game when the cache is full. Now user sessions last much longer.
source share