Handler for logout button.

        Delete cookies and return HTML that immediately closes window
760593
def logout_handler(self, **args):
        
        response = make_response(
            "<html><script>window.close();</script></html>", 200,
            {'Content-Type': "text/html"})
        response.set_cookie(self.account_cookie_name, expires=0)
        response.set_cookie(self.access_cookie_name, expires=0)
        response.headers['Access-Control-Allow-Origin'] = '*'
        return response
1161653
def logout(request, next_page=None):
    

    auth.logout(request)

    if not next_page:
        next_page = _redirect_url(request)

    if settings.CAS_LOGOUT_COMPLETELY:
        return HttpResponseRedirect(_logout_url(request, next_page))
    else:
        return HttpResponseRedirect(next_page)
255778
def r_oauth_logout(self):
        
        session.pop('oauth_user_uri', None)
        session.pop('oauth_user_name', None)
        next = request.args.get('next','')
        if next is not None:
            return redirect(session['next'])
        else:
            return {
                "template": "main::index.html"
            }
1136215
function (event) {
			F.cancel();

			if (false === F.trigger('beforeClose')) {
				return;
			}

			F.unbindEvents();

			if (!F.isActive) {
				return;
			}

			if (!F.isOpen || event === true) {
				$('.fancybox-wrap').stop(true).trigger('onReset').remove();

				F._afterZoomOut();

			} else {
				F.isOpen = F.isOpened = false;
				F.isClosing = true;

				$('.fancybox-item, .fancybox-nav').remove();

				F.wrap.stop(true, true).removeClass('fancybox-opened');

				F.transitions[ F.current.closeMethod ]();
			}
		}
707605
def logout(request):
    '''
    
    '''
    user = request.user
    serializer = LogoutSerializer(data=request.data)
    serializer.is_valid(raise_exception=True)
    data = serializer.validated_data

    if should_authenticate_session():
        auth.logout(request)
    if should_retrieve_token() and data['revoke_token']:
        try:
            user.auth_token.delete()
        except Token.DoesNotExist:
            raise BadRequest('Cannot remove non-existent token')

    return get_ok_response('Logout successful')
243177
function logout(options) {
  return async function logoutHandler(ctx) {
    let referer = formatReferer(ctx, options.logoutPath, options.rootPath);
    const user = ctx.session[options.userField];
    if (!user) {
      return redirect(ctx, referer);
    }

    const redirectURL = await options.logoutCallback(ctx, user);

    ctx.session[options.userField] = null;
    if (redirectURL) {
      referer = redirectURL;
    }
    redirect(ctx, referer);
  };
}
182111
async def logout(self, request):
        
        if "Authorization" not in request.headers:
            msg = "Auth header is not present, can not destroy token"
            raise JsonValidaitonError(msg)

        response = json_response()
        await forget(request, response)

        return response
371601
function(e) {

                var EU = YAHOO.util.Event, i, j, l, len, index,
                         ul = unloadListeners.slice(), context;

                // execute and clear stored unload listeners
                for (i=0, len=unloadListeners.length; i<len; ++i) {
                    l = ul[i];
                    if (l) {
                        context = window;
                        if (l[EU.ADJ_SCOPE]) {
                            if (l[EU.ADJ_SCOPE] === true) {
                                context = l[EU.UNLOAD_OBJ];
                            } else {
                                context = l[EU.ADJ_SCOPE];
                            }
                        }
                        l[EU.FN].call(context, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
                        ul[i] = null;
                    }
                }

                l = null;
                context = null;
                unloadListeners = null;

                // Remove listeners to handle IE memory leaks
                // 2.5.0 listeners are removed for all browsers again.  FireFox preserves
                // at least some listeners between page refreshes, potentially causing
                // errors during page load (mouseover listeners firing before they
                // should if the user moves the mouse at the correct moment).
                if (listeners) {
                    for (j=listeners.length-1; j>-1; j--) {
                        l = listeners[j];
                        if (l) {
                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], j);
                        } 
                    }
                    l=null;
                }

                EU._simpleRemove(window, "unload", EU._unload);

            }
520830
function handleLogout(req, res, next) {
		var p = new Promise(function (resolve, reject) {
			// Return success even if not currently logged in.
			if (!req.locals.user) {
				debug(`Request is not authenticated, nobody to logout.`);
				return resolve({
					success: true,
					message: 'not logged in'
				});
			}

			// Lookup current user and do the logout.
			debug(`Logging out the current authenticated session for User ${req.locals.user}`);
			AclUser.findOne({
				_id: req.locals.user._id,
				local_auth_type: 'password',
				active: true
			}, function (err, user) {
				if (err) {
					debug(`Error finding User during logout request.`, err);
					return reject(new restifyErrors.InternalError(err));
				}
				if (!user) {
					debug(`User not found during logout request.`);
					return resolve({
						success: true,
						message: 'not found'
					});
				}
				user.modifiedBy = 'logout';
				user.last_logout_date = new Date();

				// Destroy the current Bearer token 
				for (var i = user.bearer.length - 1; i > -1; i--) {
					if (req.headers.authorization == `Bearer ${user.bearer[i].token}`) {
						user.bearer.splice(i, 1);
						break;
					}
				}

				// Save the User back to the database
				user.save(function (err, result) {
					if (err) {
						debug(`Error updating user during logout request.`, err);
						return reject(new restifyErrors.InternalError(err));
					}
					resolve({
						success: true,
						message: 'success'
					});
				});
			});
		}).then(function (data) {
			req.logout(); // Provided by Passport
			res.json(data);
			next();
		}).catch(function (err) {
			debug(`Error handling logout request.`, err);
			next(err);
		});
	}
124565
def set_cookie_close_window_response(self, account_cookie_value):
        """"""
        response = make_response(
            "<html><script>window.close();</script></html>", 200,
            {'Content-Type': "text/html"})
        response.set_cookie(self.account_cookie_name,
                            account_cookie_value)
        return response
325672
def logout(self, api_version="v2.0"):
        

        cur_ctlr = self._parent_class.controller

        url = str(cur_ctlr) + "/{}/api/logout".format(api_version)

        api_logger.debug("URL = %s", url)
        return self._parent_class.rest_call(url, "get")
269247
def logout():
    

    cas_username_session_key = current_app.config['CAS_USERNAME_SESSION_KEY']
    cas_attributes_session_key = current_app.config['CAS_ATTRIBUTES_SESSION_KEY']

    if cas_username_session_key in flask.session:
        del flask.session[cas_username_session_key]

    if cas_attributes_session_key in flask.session:
        del flask.session[cas_attributes_session_key]

    if(current_app.config['CAS_AFTER_LOGOUT'] is not None):
        redirect_url = create_cas_logout_url(
            current_app.config['CAS_SERVER'],
            current_app.config['CAS_LOGOUT_ROUTE'],
            current_app.config['CAS_AFTER_LOGOUT'])
    else:
        redirect_url = create_cas_logout_url(
            current_app.config['CAS_SERVER'],
            current_app.config['CAS_LOGOUT_ROUTE'])

    current_app.logger.debug('Redirecting to: {0}'.format(redirect_url))
    return flask.redirect(redirect_url)
459799
function handleLogin(onCloudLoginSuccess) {
  const link = authLink();
  const authWindow = window.open(link, '_blank', 'width=1024,height=716');
  const handleToken = e => {
    // TODO: add security step to validate which domain the message is coming from
    authWindow.close();
    window.removeEventListener('message', handleToken);
    dropbox.setAccessToken(e.data.token);
    if (window.localStorage) {
      window.localStorage.setItem('dropbox', JSON.stringify({
        // dropbox token doesn't expire unless revoked by the user
        token: e.data.token,
        timetamp: new Date()
      }));
    }
    onCloudLoginSuccess();
  };
  window.addEventListener('message', handleToken);
}
239258
function logout(type, successCallback, errorCallback) {

    if(type && Utils.isString(type)){

      if(type === 'facebook') {
        return _logoutFacebook.call(this, successCallback, errorCallback);

      } else if(type === 'evrythng') {
        return _logoutEvrythng.call(this, successCallback, errorCallback);
      }

    }else{
      return _logoutEvrythng.call(this, type, successCallback);
    }

  }
1304901
def logout(request, redirect_url=settings.LOGOUT_REDIRECT_URL):
    
    django_logout(request)
    return HttpResponseRedirect(request.build_absolute_uri(redirect_url))
970494
def logout(request):
    """"""
    request.response.headers.extend(forget(request))
    return {'redirect': request.POST.get('came_from', '/')}
455122
public void logout() {
        if (loginContext != null) {
            try {
                loginContext.logout();
                if (logoutLogger.isDebugEnabled()) {
                    logoutLogger.debug("[ws/#" + getId() + "] Logout successful.");
                }
            } catch (LoginException e) {
                logoutLogger.trace("[ws/#" + getId() + "] Exception occurred logging out of this WebSocket session.", e);
            }
        }
        loginContext = null;
    }