Skip to content

Instantly share code, notes, and snippets.

@vincentchu
Created January 24, 2009 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentchu/51380 to your computer and use it in GitHub Desktop.
Save vincentchu/51380 to your computer and use it in GitHub Desktop.
def set_facebook_session
returning session_set = session_already_secured? || secure_with_facebook_params! || secure_with_cookies! || secure_with_token! do
if session_set
begin
post('facebook.users.getLoggedInUser', :session_key => facebook_session.session_key)
capture_facebook_friends_if_available!
Session.current = facebook_session
rescue
clear_facebook_session_information
clear_fb_cookies!
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment