save user after login and read from io stream