facebook PHP error 102, Session key invalid or no longer valid -
i'm trying create simple login using php , facebook. problem i've result when it's supposed shown "iframe","popup" or "page" (none of them working)
api error code: 102 api error description: session key invalid or no longer valid error message: iframe dialogs must called session key
the code i'm using this:
$config = array( 'appid' => 'code1', 'secret' => 'code2', 'cookie' => true ); $params = array( 'redirect_uri' => 'http://domain.dev', 'display'=>'iframe' ); $facebook = new facebook($config); $user = $facebook->getuser(); if ($user) { //something } else { $user = null; $loginurl = $facebook->getloginurl($params); //redirect loginurl }
try :
if (!(isset($_request['state'])) { $loginurl = $facebook->getloginurl(array( 'redirect_uri' => 'http://domain.dev', 'display' => 'popup', 'scope' => 'user_photos' )); echo $loginurl;
for more reference can utilize :
http://www.9lessons.info/2011/02/login-with-facebook-and-twitter.html
php facebook
No comments:
Post a Comment