It simply catches the error, clears the cookies and redirects to the root of the site. You could instead redirect to a nice error page, explaining why they got logged out, and make it easy for them to connect again.

Note that FacebookService.ClearFacebookCookies is the same as the code vatlab posted.