Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook logout using OAuth server side
    primarykey
    data
    text
    <p>I just read the manual but it doesn't say how to log a user out. My problem is similar to this:</p> <p><a href="https://stackoverflow.com/questions/8817569/facebook-js-sdk-fb-logout-doesnt-terminate-user-session">Facebook JS SDK FB.logout() doesn&#39;t terminate user session</a></p> <p>But I'm using the serverside flow. I think I need to know the name(s) of which cookie(s) to invalidate since deleting the cookie would log the user out wouldn't it?</p> <p>Here's me logout where I assume I know the name of the cookie that could have changed:</p> <pre><code>class FBLogoutHandler(webapp2.RequestHandler): csrf_protect = False def get(self): logging.debug('in fblogout') current_user = main.get_user_from_cookie(self.request.cookies, facebookconf.FACEBOOK_APP_ID, facebookconf.FACEBOOK_APP_SECRET) if current_user: graph = main.GraphAPI(current_user['access_token']) profile = graph.get_object('me') accessed_token = current_user['access_token'] logging.debug('setting cookie') self.set_cookie('fbsr_' + facebookconf.FACEBOOK_APP_ID, None, expires=time.time() - 86400) self.redirect('https://www.facebook.com/logout.php?next=http://www.koolbusiness.com/fbredirect&amp;access_token=%s' % accessed_token) def set_cookie( self, name, value, expires=None, ): if value is None: value = 'deleted' expires = datetime.timedelta(minutes=-50000) jar = Cookie.SimpleCookie() jar[name] = value jar[name]['path'] = '/' if expires: if isinstance(expires, datetime.timedelta): expires = datetime.datetime.now() + expires if isinstance(expires, datetime.datetime): expires = expires.strftime('%a, %d %b %Y %H:%M:%S') jar[name]['expires'] = expires self.response.headers.add_header(*jar.output().split(': ', 1)) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload