Featured image

If you are using your own authentication implementation, the fastest and easiest way to log out all users of your Rails application is to change the secret or change the name of the session cookie. If you’re wondering “Why?”, my answer is this: When you purge users from your database, some of these users may be logged in to your site. And if you delete them without logging them out, the next time they log in to your site, they’ll see a 500 error (since they simply won’t be found in your database).

How often do you reset user authentication in your projects?