fix usersession bug and add foradmin tests