psereno's avatar

Logout from facebook with socialite

Hi,

I have facebook login working on my website but when I logout the user stills logged in on facebook. I need to logout from facebook.

How can I logout also from facebook when I logout from the web site?

Thanks.

0 likes
4 replies
burlresearch's avatar

You can't control Facebook from your Laravel app. You can only logout of your Laravel app.

You have to go to Facebook, to logout from Facebook.

psereno's avatar

It isn’t possible to do it by JavaScript or PHP? If Socialite have the data from this user, like his token, it should be possible to logout from Facebook as well, no?

1 like
cmdobueno's avatar

No. No. No. No. No.

Why on earth would facebook want to allow that?

psereno's avatar

Yes it's possible!!! One way is to get the logout url from facebook. You can use for example php-graph-sdk to do that (I already tested and works well with php and javascript). The problem is that i'm not able to get the token using Socialite, when i use Socialite::driver('facebook')->user() it only works when is inside the callback function, but I need to get the token in another funcion, in this case the logout function... And the token stored by Socialite differes from the token created by the facebook when the user logon. How can I do that?

1 like

Please or to participate in this conversation.