views:

38

answers:

0

Hi

Facebook document that you need to do the following for canvas login

  1. Include facebook library
  2. Instantiate class with App Id and secret
  3. Check that the user has a valid session

    If they do check also that you can get there user object by doing an api call /me

    If they dont then process the login redirect

All this especially the Facebook calls can take quite some time to process

The example shows this in terms of code http://github.com/facebook/php-sdk/blob/master/examples/example.php

And from what I read it seems required on every page. Because a user can logout / remove app / change permissions etc during the session

My question is what is the ideal way of doing the above in terms of performance gains, but still making sure that it conforms to the nuiances of facebook.

Facebook do give a session expire time which seems to be in GMT.

I code in PHP using the Zend Framework but I suppose the above relates to all languages.

Appreciate your help on this