the logout 'success' event

@param  {Object} req express request object
@param  {Object} res express response object
@api public
14515
function(req, res) {

      req.session.authenticated = false;

      var defaultString = 'You have successfully logged out.';

      // now respond or redirect
      var postResponse = this._resolvePostAction(waterlock.config.postActions.logout.success,
        defaultString);

      if (typeof postResponse === 'string' && this._isURI(postResponse)) {
        res.redirect(postResponse);
      } else {
        res.ok(postResponse);
      }
    }
620543
function logoff() {
    var token = cache.get('token');
    var dfrd = Q.defer();
    if (!token) {
      dfrd.reject(MODULE_ERRORS.undefinedToken);
    } else {
      request(format(URLs.logoff, PROTOCOL, conf.host, token),
        function(err) {
          if (err) {
            dfrd.reject(err);
          } else {
            dfrd.resolve(true);
          }
        });
    }
    return dfrd.promise;
  }
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
904637
function handleLogin(user, req, res, next) {


    var token;
    var profile;
    var tokenExpiresInMinutes;
    var envelope = {
      data: user,
      isAuthenticated: true,
      meta: {}
    };

    // First handle the case where the user was not logged in.
    if (!user) {
      if (authConfig.maintenance === 'cookie') {
        req.logout();
      }
      return res.status(401).send('Wrong password or no such user.');
    }
    // user_id is how it is in the schema
    /* jshint ignore:start */
    // Now handle the case where we did get a user record.
    if (authConfig.maintenance === 'token') {
      // For token authentication we want to add a token.
      profile = {
        username: user.username,
        email: user.email,
        userdata_id: user.userdata_id
      };
      /* jshint ignore:end */
      tokenExpiresInMinutes = authConfig.expiresInMinutes || 60;
      envelope.meta.token = generateToken(profile, tokenExpiresInMinutes,
        secrets.authTokenSecret);

      envelope.meta.expires = getExpirationTime(tokenExpiresInMinutes);
      return res.status(200).send(envelope);
    } else if (authConfig.maintenance === 'cookie') {
      // For cookie authentication we want to login the user.
      req.login(user, function (err) {
        if (err) {
          return next(err);
        } else {
          return res.status(200).send(envelope);
        }
      });
    }
  }
494381
function redirectToNext(req, res) {
  var redirectTo = req.session.next || '';
  req.session.next = null; // Null it so that we do not use it again.
  res.redirect(redirectTo);
}
1276154
def logout(context, request):
    """"""

    @request.after
    def forget(response):
        request.app.forget_identity(response, request)

    return {
        'status': 'success'
    }
171237
function on_connect(res){
	//console.log('STATUS: ' + res.statusCode);
	//console.log('HEADERS: ' + JSON.stringify(res.headers));
	res.setEncoding('utf8');
	var raw_data = '';
	res.on('data', function (chunk) {
	    //console.log('BODY: ' + chunk);
	    raw_data = raw_data + chunk;
	});
	// Throw to .
	res.on('end', function () {
	    //console.log('END with: ' + raw_data);
	    var response = new anchor._response_handler(raw_data);
	    if( response && response.okay() ){
		anchor.apply_callbacks('success', [response, anchor]);
	    }else{
		// Make sure that there is something there to
		// hold on to.
		if( ! response ){
		    response = new anchor._response_handler(null);
		    response.okay(false);
		    response.message_type('error');
		    response.message('null response');
		}else{
		    response.message_type('error');
		    response.message('bad response');
		}
		anchor.apply_callbacks('error', [response, anchor]);
	    }
	});
    }
578479
function(req, res) {
      waterlock.logger.debug('user logout');
      delete(req.session.user);

      if (req.session.authenticated) {
        this.logoutSuccess(req, res);
      } else {
        this.logoutFailure(req, res);
      }
    }
1151399
function onResponse( res ) {
		self.res.status = res.statusCode;
		self.res.headers = res.headers;

		// TODO: record headers length

		res.on( 'data', onData );
		res.on( 'end', onEnd );
	}
1282437
function resp(response) {
        if (!request.session) {
          debug("no session")
          return response
        }

        if (utils.shouldSetCookie(request) === false) {
          return response
        }

        // only send secure cookies via https
        if (request.session.cookie.secure && !utils.issecure(request, trustProxy)) {
          debug("not secured")
          return response
        }
        // touch session
        request.session.touch()
        // set cookie
        utils.setcookie(response, name, request.sessionID, secrets[0], request.session.cookie.data)

        if (utils.shouldDestroy(request)) {
          debug("destroying")
          store.destroy(request.sessionID, function ondestroy(err) {
            if (err) throw err
            debug("destroyed")
          })
        } else if (utils.shouldSave(request)) {
          request.session.save(function onsave(err) {
            if (err) throw err
          })
        } else if (utils.storeImplementsTouch && utils.shouldTouch(request)) {
          // store implements touch method
          debug("touching")
          store.touch(request.sessionID, request.session, function ontouch(err) {
            if (err) throw err
            debug("touched")
          })
        }

        return response
      }
11738
function (req, res) {
      req.session.loggedIn = true;
      if (config.oauth2.validateHostedDomain) {
        req.session.allowedDomain = config.oauth2.hostedDomain;
      }
      var redirect = req.session.oauth2return || '/';
      delete req.session.oauth2return;
      res.redirect(redirect);
    }
413605
function kill(req, res) {
  if(!this._busy || !this.ps) return res.send(NotBusy);
  if(this._busy && this._written) return res.send(Unkillable);
  this.ps.removeAllListeners();
  this._busy = false;
  this._written = false;
  function onClose() {
    res.send(null, Constants.OK);
    // re-spawn for next execution
    //this.spawn();
  }
  this.ps.once('close', onClose.bind(this))
  process.kill(this.ps.pid, 'SIGQUIT');
  this.emit('kill');
}
1108880
private String getValidLogoutExitPage(HttpServletRequest req) {

        boolean valid = false;
        String exitPage = req.getParameter("logoutExitPage");
        if (exitPage != null && exitPage.length() != 0) {
            boolean logoutExitURLaccepted = verifyLogoutURL(req, exitPage);
            if (logoutExitURLaccepted) {
                exitPage = removeFirstSlash(exitPage);
                exitPage = compatibilityExitPage(req, exitPage);
                valid = true;
            }
        }
        return valid == true ? exitPage : null;
    }
306626
def logout!
        logout   = EPP::Commands::Logout.new
        command  = EPP::Requests::Command.new(auth_tid, logout)
        request  = EPP::Request.new(command)
        response = send_recv_frame(request)

        return true if response.code == 1500
        raise @error = ResponseError.new(response.code, response.message, response.to_xml)
      end
469215
function expressResponseError_silent(response, message) {
  let errorMessage = "there was an error in the request";
  if(message)
    errorMessage = message
  response.json({ success: false, error: errorMessage });
}
385924
function (req, res) {
    var oauthQueryStateToken = req.query.state;
    var oauthCookieStateToken = req.cookies.oauthStateToken;

    if (!oauthQueryStateToken || (!oauthCookieStateToken)) {
      return false;
    } else if (oauthQueryStateToken !== oauthCookieStateToken) {
      return false;
    }

    res.clearCookie('oauthStateToken');

    return true;
  }
720338
function handleVerify(req, res, next) {
		var p = new Promise(function (resolve, reject) {
			const currentToken = req.params.token || false;
			if (!currentToken || currentToken == 'missing') {
				debug(`Verify request, token is missing.`);
				return reject(new restifyErrors.BadRequestError("Verify token is missing"));
			}

			const postVerifyHandler = function (err, user, info) {
				if (err) {
					debug(`Error handling verify request.`, err);
					return reject(new restifyErrors.InternalError(err));
				}
				// The API doesn't store any state in a session!
				req.login(user, {
					'session': false
				}, function (err) {
					if (err) {
						debug(`Login failed during verify request.`, err);
						return reject(new restifyErrors.InternalError("Failed logging in verified user"));
					}
					debug(`User is verified and logged in.`);
					var data = {
						'success': true,
						'token': req.locals.basic_login_token
					};
					resolve(data);
				});
			};

			passport.authenticate('local-verify', postVerifyHandler)(req, res);
		}).then(function (data) {
			res.json(data);
			next();
		}).catch(function (err) {
			debug(`Error during verify request.`, err);
			next(err);
		});
	}