Fix double-logout bug with SSL