SSP-1899 Enhance login/logout functionality and reliability