PHP Facebook logout -
i using php sdk creating facebook login, works fine when want logout , use getlogouturl method returns logout url in form:
https://www.facebook.com/logout?next=google.com&access_token=my_access_token after redirect page this page not avalible page on fb , not logged out. idea wrong ? or sdk bug ? thanks.
i have created article facebook login logout graph api php. can see following code logout facebook php. code logout.php
session_start(); if(isset($_session['fb_access_token'])){ require_once 'php-graph-sdk-5.5/src/facebook/autoload.php'; $fb = new facebook\facebook([ 'app_id' => 'app-id', // replace {app-id} app id 'app_secret' => 'app-id-secret', 'default_graph_version' => 'v2.4', ]); $url = 'https://www.facebook.com/logout.php?next=your-website-return-url/&access_token='.$_session['fb_access_token']; session_destroy(); header('location: '.$url); } if need full source code can see link
Comments
Post a Comment