How to completely log out of Facebook?

36 views
Skip to first unread message

MrBlankman

unread,
Jan 14, 2011, 2:07:18 PM1/14/11
to mini_fb
Im using the recommended method for oauth to login a user, which works
great. Something like this:

MiniFB.oauth_url(APP_CONFIG[:facebook]
['api_key'],facebook_oauth_callback_url,
:scope=>"publish_stream,email,offline_access")

followed by:

access_token_hash =
MiniFB.oauth_access_token(APP_CONFIG[:facebook]['api_key'],
facebook_oauth_callback_url, APP_CONFIG[:facebook]['app_secret'],
params[:code])
access_token = access_token_hash["access_token"]
fb = MiniFB::OAuthSession.new(access_token)

in the create method, where I then create a user and set the cookie to
the user_id.

The problem is that when they LOG OUT, which is done by setting the
user cookie to nil, they are still technically logged into Facebook.
So if they log out cause they want their friend to log in when their
friend clicks on the redirect link to oauth, Facebook automatically
logs in the original person's account. The only way to change this is
to have that person go to Facebook.com and log out.

How do I use mini_fb to FULLY log the user out so that their friend
can log in?

Travis Reeder

unread,
Jan 14, 2011, 2:11:52 PM1/14/11
to min...@googlegroups.com
Don't think you can, they have to logout on facebook.

MrBlankman

unread,
Jan 15, 2011, 10:01:04 AM1/15/11
to mini_fb
Actually I figured out a way. It's quite easy actually :)

If you use the Javascript SDK and call FB.logout() when the log out
link is clicked, it will log the user out of your app as well as
Facebook.

Joe Chan

unread,
Jan 16, 2011, 8:42:23 AM1/16/11
to min...@googlegroups.com
any example can provide ?

: D

2011/1/15 MrBlankman <jlip...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "mini_fb" group.
To post to this group, send email to min...@googlegroups.com.
To unsubscribe from this group, send email to mini_fb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mini_fb?hl=en.


MrBlankman

unread,
Jan 16, 2011, 5:23:09 PM1/16/11
to mini_fb
Just use the Facebook Javascript SDK to initialize and then do a
FB.logout() on click for the logout link.


On Jan 16, 8:42 am, Joe Chan <joec...@gmail.com> wrote:
> any example can provide ?
>
> : D
>
> 2011/1/15 MrBlankman <jlippi...@gmail.com>
>
>
>
>
>
>
>
> > Actually I figured out a way.  It's quite easy actually :)
>
> > If you use the Javascript SDK and call FB.logout() when the log out
> > link is clicked, it will log the user out of your app as well as
> > Facebook.
>
> > On Jan 14, 2:11 pm, Travis Reeder <tree...@gmail.com> wrote:
> > > Don't think you can, they have to logout on facebook.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "mini_fb" group.
> > To post to this group, send email to min...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > mini_fb+u...@googlegroups.com<mini_fb%2Bunsu...@googlegroups.com >
> > .

Code Daemon

unread,
Mar 1, 2011, 12:33:03 AM3/1/11
to mini_fb
You are using the JS SDK for the entire login process then? I've been
trying all day to get omniauth to work with a single user logout but
to no avail.




On Jan 16, 2:23 pm, MrBlankman <jlippi...@gmail.com> wrote:
> Just use the Facebook Javascript SDK to initialize and then do a
> FB.logout() on click for the logout link.
>
> On Jan 16, 8:42 am, Joe Chan <joec...@gmail.com> wrote:
>
>
>
>
>
>
>
> > any example can provide ?
>
> > : D
>
> > 2011/1/15 MrBlankman <jlippi...@gmail.com>
>
> > > Actually I figuredouta way.  It's quite easy actually :)
>
> > > If you use the Javascript SDK and call FB.logout() when thelogout
> > > link is clicked, it willlogthe useroutof your app as well as
Reply all
Reply to author
Forward
0 new messages