improve the function of the getting a login session