SSO recognizing moved to Middleware. Logout handler implemented.