I am facing an error with my web app that uses Facebook connect that occurs when the user has both my web app open and Facebook.com open and logs out of Facebook.com. Since my app and the Facebook Connect library is unaware that the session is no longer valid, when it tries to user certain Facebook Connect functions that require a valid session, I get a 'FacebookRestClientException' with message 'Session key invalid or no longer valid.' Just wondering what the best practice is for handling this case for a php app.
From Googling I found that there's a JS function that pings the Facebook server to see if a user is logged in but I need a server side solution.