简体   繁体   中英

facebook connect logs user out of facebook

I use the php sdk for facebook connect. The Login as well as the logut works well, but the link facebook generated with: $facebook->getLogoutUrl(); also logs the user out of facebook. How can i change this, so that only the user is logged out of my site but not of facebook?

All i found out is, that i must delete the facebook session and cookie . Is there a function for it in the sdk or how can i do this?

Thank you for any help

ruvenm

When u click/access the values returned by getLogoutUrl, it will automatically logout the user session from facebook also.

If u dont want to logout from facebook, consider writing your own function for logout which destroys the sessions set by your application(I think u may hv atleast one session variable only related to the app)..

something like this

public function fnLogout()
{
  unset($_SESSION('uid')); 
  // add more session unset stmts for every session variable u may have set
  // write some code here to redirect to your app home page or something
}

Keep in notice that, whenever you try to login again,you would have already logged in to facebook and you should try setting up your own session after checking the current user logged in!!

$user = $facebook->getUser(); // will get the current fb user logged in

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM