This question is not a duplicate of this one.
I don\'t want to know whether the user has authorized my application, but if the user is logged into facebook (complete
There is a non-hack, officially-supported way of doing this for Facebook (I think the last version of the docs was clearer on this point). Using the Javascript SDK, you can do:
An aside: if XAuth had caught on, it would be possible to do this in a more universal and supported way for any site supporting that standard.