Fixing a bug where all users would be logged out unexpectedly