failure a cookie
433224
public static void failureCookie(HttpServletRequest request,
                                     HttpServletResponse response, String name) {
        failureCookie(request, response, name, null);
    }
520365
def handle_error(self, failure):
        
        self.logger.error(repr(failure))

        if failure.check(HttpError):
            response = failure.value.response
            self.logger.error(u'HttpError on %s', response.url)
            self.logger.error(u'HttpError Code: %s', response.status)
            if response.status in (401, 403):
                # If the error is from invalid login, tell the user
                self.logger.error(
                    "Credentials failed. Either add/update the current credentials "
                    "or remove them to enable auto auth"
                )
        elif failure.check(DNSLookupError):
            request = failure.request
            self.logger.error(u'DNSLookupError on %s', request.url)
607060
def retry_failed(FailAdmin, request, queryset):
    """"""
    for task in queryset:
        async_task(task.func, *task.args or (), hook=task.hook, **task.kwargs or {})
        task.delete()
952010
def create_cookie(name, value, **kwargs):
    
    result = {
        'version': 0,
        'name': name,
        'value': value,
        'port': None,
        'domain': '',
        'path': '/',
        'secure': False,
        'expires': None,
        'discard': True,
        'comment': None,
        'comment_url': None,
        'rest': {'HttpOnly': None},
        'rfc2109': False,
    }

    badargs = set(kwargs) - set(result)
    if badargs:
        err = 'create_cookie() got unexpected keyword arguments: %s'
        raise TypeError(err % list(badargs))

    result.update(kwargs)
    result['port_specified'] = bool(result['port'])
    result['domain_specified'] = bool(result['domain'])
    result['domain_initial_dot'] = result['domain'].startswith('.')
    result['path_specified'] = bool(result['path'])

    return cookielib.Cookie(**result)
259047
public function cookiesSupported()
    {
        Cookie::set(self::TEST_COOKIE, 1);
        $cookie = Cookie::get(self::TEST_COOKIE);
        Cookie::force_expiry(self::TEST_COOKIE);

        return (empty($cookie)) ? false : true;
    }
1210195
public function setCookie($cookie_key, $cookie_value, $expire = null, $path = null, $domain = null, $secure = null, $httpOnly = null)
    {
        if ($this->isSingle()) {
            ResponseKit::setCookie($cookie_key, $cookie_value, $expire, $path, $domain, $secure, $httpOnly);
        }
    }
409467
def setCookies(browser, domain, cookieJar):
        
        return BrowserCookies.browsers[browser].writeCookies(domain, cookieJar)
610883
def logout(cookie=None):
    '''
    
    '''
    payload = '<aaaLogout cookie="{0}" inCookie="{0}"></aaaLogout>'.format(cookie)
    __utils__['http.query'](DETAILS['url'],
                            data=payload,
                            method='POST',
                            decode_type='plain',
                            decode=True,
                            verify_ssl=False,
                            raise_error=True,
                            headers=DETAILS['headers'])
    return
238819
def delete_cookie(self, key: str, path: str='/', domain: Optional[str]=None) -> None:
        """"""
        self.set_cookie(key, expires=datetime.utcnow(), max_age=0, path=path, domain=domain)
1118504
function fail (label, messages) {
  messages.showAnyWarnings('loading')
  messages.showErrors('loading')

  const oops = new Error(messages.errors.join('\n'))
  oops.errors = messages.errors
  throw oops
}
1148521
function(req, res, user, error) {
      waterlock.logger.debug('user register failure');

      if (user) {
        var address = this._addressFromRequest(req);

        var attempt = {
          user: user.id,
          successful: false
        };

        _.merge(attempt, address);

        waterlock.Attempt.create(attempt).exec(function(err) {
          if (err) {
            waterlock.logger.debug(err);
          }
        });
      }

      if (req.session.authenticated) {
        req.session.authenticated = false;
      }

      delete(req.session.user);

      // now respond or redirect
      var postResponse = this._resolvePostAction(waterlock.config.postActions.register.failure,
        error);

      if (typeof postResponse === 'string' && this._isURI(postResponse)) {
        res.redirect(postResponse);
      } else {
        res.forbidden(postResponse);
      }
    }
452262
function fail(err, status=1) {
    console.log(process.env.DEBUG ? err.stack : err.message);
    process.exit(status);
}
644084
function onEntityRetrievalFailure( serverResponse ) {
			self.logInterface.error( self.logPrefix + "Unable to retrieve entity with ID '" + id + "' from the server.",
				serverResponse );
			self.scope.$emit( "absyncError", serverResponse );

			if( self.throwFailures ) {
				throw serverResponse;
			}
		}
1165664
def cookie_set(self, name, value):
		
		if not self.headers_active:
			raise RuntimeError('headers have already been ended')
		cookie = "{0}={1}; Path=/; HttpOnly".format(name, value)
		self.send_header('Set-Cookie', cookie)
1187871
@SuppressWarnings("unchecked")
	private void saveToCookie(IExtendedRequest req, String reqURL, AuthenticationResult result, boolean keepInput) {

		String strParam = null;
		try {
			strParam = serializePostParam(req, reqURL, keepInput);
		} catch (Exception e) {
			if (tc.isDebugEnabled()) {
				Tr.debug(tc, "IO Exception storing POST parameters onto a cookie: ", new Object[] { e });
			}
		}

		if (strParam != null) {
			Cookie paramCookie = new Cookie(POSTPARAM_COOKIE, strParam);
			paramCookie.setMaxAge(-1);
			paramCookie.setPath(reqURL);
			if (webAppSecurityConfig.getHttpOnlyCookies()) {
				paramCookie.setHttpOnly(true);
			}
			if (webAppSecurityConfig.getSSORequiresSSL()) {
				paramCookie.setSecure(true);
			}
			result.setCookie(paramCookie);
		}

		if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
			Tr.debug(tc, "encoded POST parameters: " + strParam);
		}
	}
648230
function onEntityDeletionFailed( serverResponse ) {
			self.logInterface.error( serverResponse.data );
			self.scope.$emit( "absyncError", serverResponse );

			if( self.throwFailures ) {
				throw serverResponse;
			}
		}
360159
def _fail(self, event, message='Invalid credentials'):
        """"""

        notification = {
            'component': 'auth',
            'action': 'fail',
            'data': message
        }

        ip = event.sock.getpeername()[0]

        self.failing_clients[ip] = event
        Timer(3, Event.create('notify_fail', event.clientuuid, notification, ip)).register(self)