Generate and retrieve user ID