php - My website can post to Facebook Feed of a user although he is logged out from FB -
on page, users can upload pictures , post them facebook wall - should able post on wall if logged in facebook account. check user status piece of code:
// check if user connected facebook $facebook = new facebook(array( 'appid' => yii::app()->params['fbappid'], 'secret' => yii::app()->params['fbsecret'], )); $user = $facebook->getuser(); if ($user = $facebook->getuser()) { try { $user_profile = $facebook->api('/me'); echo "you logged in"; } catch (facebookapiexception $e) { $user = null; echo "you logged out"; } }
(and code, recommended check if user has not session valid fb login, returns true although no longer logged in @ fb.)
now, if log in own page via facebook connect, , log out fb - still logged in on own webpage. thats okay moment. shouldn't work piece of code:
$facebook->api('/me/feed', 'post', $attachment);
which means website post picture user uploaded directly user's feed. , seems work although user logged out facebook...
btw, request no offline permissons.
best wishes, sebastian
Comments
Post a Comment