Implemented automatic re-login when session expires