I often want to clear the session store in Rails, in particular, the default cookie-based session store. Some sites seem to suggest that
rake tmp:sessions:clear
accomplishes this task, but it appears that it does not. What is the proper way to clear the cookie-based session store?
The problem is that cookies are client side. Running a rake task on your server won’t delete cookies on all the machines that have visited the web page, obviously.
Perhaps you can use
session.clearin your controllers somehow? You’re right about changing the cookie key, though. Doing so would invalidate any session belonging to the old key. You would have to rescue fromActionController::StaleSession(or something like that), but it’d work.