Fixing session-related issues when logged out.