In my system, the user logs in with either Yahoo or Google, and a cookie is set so the user stays logged in.
I'm picturing a mismatch between the user being logged in to my system and him being logged in to the outside system.
How should I go about dealing with these situations?
If it matters, I'm using LightOpenID.
Instead of doing a 1-to-1 account mapping with an identity provider, it might be a better idea to keep your own system accounts, and map OpenIDs to your accounts. Your users have an account on your system, but uses OpenID as the authentication mechanism (instead of user/pass).
For example, I might have multiple OpenIDs that I can log into StackOverflow with.
The advantages are: