Prevents sessions from being delivered
962240
protected void disableSessionDelivery() {
        bugsnag.setSessionDelivery(new Delivery() {
            @Override
            public void deliver(Serializer serializer, Object object, Map<String, String> headers) {
                // Do nothing
            }

            @Override
            public void close() {
                // Do nothing
            }
        });
    }
326492
def process_allow_action(processors, action, argument):
    """"""
    for processor in processors:
        processor(action, argument)
    db.session.commit()
159535
def unlock(self, session=None):
        
        cmd = SON([("fsyncUnlock", 1)])
        with self._socket_for_writes(session) as sock_info:
            if sock_info.max_wire_version >= 4:
                try:
                    with self._tmp_session(session) as s:
                        sock_info.command(
                            "admin", cmd, session=s, client=self)
                except OperationFailure as exc:
                    # Ignore "DB not locked" to replicate old behavior
                    if exc.code != 125:
                        raise
            else:
                message._first_batch(sock_info, "admin", "$cmd.sys.unlock",
                                     {}, -1, True, self.codec_options,
                                     ReadPreference.PRIMARY, cmd,
                                     self._event_listeners)
829581
public static function destroySessionIfNotAllowed(){
        if (!self::isAllowedSession() && ini_get("session.use_cookies") && session_status() == PHP_SESSION_ACTIVE) {
            $params = session_get_cookie_params();
            setcookie(session_name(), '', time() - 42000,
                $params["path"], $params["domain"],
                $params["secure"], $params["httponly"]
            );
        }
    }
382256
def stop_db_session(exc=None):
    """"""
    # print('==> Stop session', type(exc))

    if has_db_session():
        exc_type = None
        tb = None

        if exc:
            exc_type, exc, tb = get_exc_info(exc)

        db_session.__exit__(exc_type, exc, tb)
885020
protected function _allowSessionStart()
    {
        $blAllowSessionStart = true;
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        // special handling only in non-admin mode
        if (!$this->isAdmin()) {
            if (\OxidEsales\Eshop\Core\Registry::getUtils()->isSearchEngine() || $myConfig->getRequestParameter('skipSession')) {
                $blAllowSessionStart = false;
            } elseif (\OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie('oxid_' . $myConfig->getShopId() . '_autologin') === '1') {
                $blAllowSessionStart = true;
            } elseif (!$this->_forceSessionStart() && !\OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie('sid_key')) {
                // session is not needed to start when it is not necessary:
                // - no sid in request and also user executes no session connected action
                // - no cookie set and user executes no session connected action
                if (!\OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie($this->getName()) &&
                    !($myConfig->getRequestParameter($this->getName()) || $myConfig->getRequestParameter($this->getForcedName())) &&
                    !$this->_isSessionRequiredAction()
                ) {
                    $blAllowSessionStart = false;
                }
            }
        }

        return $blAllowSessionStart;
    }
933355
def cancel_requests(self):
        """"""
        self._timer.stop()
        self._job = None
        self._args = None
        self._kwargs = None
95608
def connectionLost(self, reason):
        """"""
        self.factory.loader.db.session.commit()
        if reactor.running:
            reactor.stop()
229685
synchronized void freeze() {
        if (frozen) {
            return;
        }
        if (userAgent == null) {
            setDefaultUserAgent();
        }
        serviceMap = new HashMap<String, ServiceEndpoint>();
        if (log.isDebugEnabled()) {
            StringBuilder buf = new StringBuilder();
            buf.append("Creating MwsConnection {");
            buf.append("applicationName:");
            buf.append(applicationName);
            buf.append(",applicationVersion:");
            buf.append(applicationVersion);
            buf.append(",awsAccessKeyId:");
            buf.append(awsAccessKeyId);
            buf.append(",uri:");
            buf.append(endpoint.toString());
            buf.append(",userAgent:");
            buf.append(userAgent);
            buf.append(",connectionTimeout:");
            buf.append(connectionTimeout);
            if (proxyHost != null && proxyPort != 0) {
                buf.append(",proxyUsername:");
                buf.append(proxyUsername);
                buf.append(",proxyHost:");
                buf.append(proxyHost);
                buf.append(",proxyPort:");
                buf.append(proxyPort);
            }
            buf.append("}");
            log.debug(buf);
        }

        BasicHttpParams httpParams = new BasicHttpParams();
        httpParams.setParameter(CoreProtocolPNames.USER_AGENT, userAgent);
        HttpConnectionParams
                .setConnectionTimeout(httpParams, connectionTimeout);
        HttpConnectionParams.setSoTimeout(httpParams, socketTimeout);
        HttpConnectionParams.setStaleCheckingEnabled(httpParams, true);
        HttpConnectionParams.setTcpNoDelay(httpParams, true);

        connectionManager = getConnectionManager();
        httpClient = new DefaultHttpClient(connectionManager, httpParams);
        httpContext = new BasicHttpContext();
        if (proxyHost != null && proxyPort != 0) {
            String scheme = MwsUtl.usesHttps(endpoint) ? "https" : "http";
            HttpHost hostConfiguration = new HttpHost(proxyHost, proxyPort, scheme);
            httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, hostConfiguration);

            if (proxyUsername != null && proxyPassword != null) {
                Credentials credentials = new UsernamePasswordCredentials(proxyUsername, proxyPassword);
                CredentialsProvider cprovider = new BasicCredentialsProvider();
                cprovider.setCredentials(new AuthScope(proxyHost, proxyPort), credentials);
                httpContext.setAttribute(ClientContext.CREDS_PROVIDER, cprovider);
            }
        }
        headers = Collections.unmodifiableMap(headers);
        frozen = true;
    }
356956
public void removeHttpSession(HttpSession session) {
		if (session == activeSession) {
			activeSession = null;
		}
		synchronized (this.sessions) {
			this.sessions.remove(session);
		}
		this.model.removeHttpSession(session);
		session.invalidate();
	}
724354
private int preemptSession(SessionSchedulable schedulable,
      int maxToPreemt, long maxRunningTime) throws InvalidSessionHandle {
    Session session = schedulable.getSession();
    List<Integer> grantIds;
    synchronized (session) {
      grantIds = session.getGrantsToPreempt(maxToPreemt, maxRunningTime, type);
    }
    List<ResourceGrant> revokedGrants =
      sessionManager.revokeResource(session.getHandle(), grantIds);
    for (ResourceGrant grant : revokedGrants) {
      nodeManager.cancelGrant(
          grant.nodeName, session.getSessionId(), grant.getId());
    }
    sessionNotifier.notifyRevokeResource(
        session.getHandle(), revokedGrants, true);
    int preempted = revokedGrants.size();
    LOG.info("Preempt " + preempted + " " + type +
        " tasks for Session:" + session.getHandle());
    return preempted;
  }
1297479
public Response unLock(Session session, String path, List<String> tokens)
   {
      try
      {
         try
         {
            Node node = (Node)session.getItem(path);

            if (node.isLocked())
            {
               node.unlock();
               session.save();
            }

            return Response.status(HTTPStatus.NO_CONTENT).build();
         }
         catch (PathNotFoundException exc)
         {
            if (nullResourceLocks.isLocked(session, path))
            {
               nullResourceLocks.checkLock(session, path, tokens);
               nullResourceLocks.removeLock(session, path);
               return Response.status(HTTPStatus.NO_CONTENT).build();
            }

            return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessage()).build();
         }

      }
      catch (LockException exc)
      {
         return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()).build();
      }
      catch (Exception exc)
      {
         log.error(exc.getMessage(), exc);
         return Response.serverError().entity(exc.getMessage()).build();
      }

   }
199592
def unauthorized(msg = t('flashes.failure_when_not_signed_in'))
      authenticate_session.logout
      respond_to do |format|
        format.any(:js, :json, :xml) { head :unauthorized }
        format.any { redirect_unauthorized(msg) }
      end
    end
401217
function ssEnabled () {
  let support = false
  try {
    window.sessionStorage.setItem('_t', 1)
    window.sessionStorage.removeItem('_t')
    support = true
  } catch (e) {}

  return support
}
640917
public void unlockSession(HttpSession sess) {
      if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
          LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[UNLOCK_SESSION]);
      }
      SessionData session= (SessionData)sess;
      Object obj = session.getSessionLock(Thread.currentThread());
      if (obj!=null) {
          LinkedList linkList = session.getLockList();
          synchronized(linkList) {
              try {
                  linkList.remove(obj);
                  if (linkList.size()>0) {
                      Object nextLock = linkList.getFirst();
                      if (nextLock !=null) {
                          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
                              LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, methodNames[UNLOCK_SESSION], "notify after postInvoke");
                          }
                          synchronized(nextLock) {
                              nextLock.notify();
                          }
                      }
                  } else {
                      session.clearSessionLocks();
                  }
              } catch (Exception e) {
                  if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
                      LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, methodNames[UNLOCK_SESSION], "failed to unlock session", e);
                  }
              }
          }
      }                   
      if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
          LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[UNLOCK_SESSION]);
      }
  }
1119651
def session_preparation(self):
        """"""
        self._test_channel_read()
        self.set_base_prompt()
        if self.secret:
            self.enable()
        else:
            self.asa_login()
        self.disable_paging(command="terminal pager 0")
        if self.allow_auto_change:
            try:
                self.send_config_set("terminal width 511")
            except ValueError:
                # Don't fail for the terminal width
                pass

        # Clear the read buffer
        time.sleep(0.3 * self.global_delay_factor)
        self.clear_buffer()
1051243
public void removeHttpSession(final HttpSession session) {
		if (View.isInitialised() && !EventQueue.isDispatchThread()) {
			EventQueue.invokeLater(new Runnable() {

				@Override
				public void run() {
					removeHttpSession(session);
				}
			});

			return;
		}

		int index = sessions.indexOf(session);
		sessions.remove(index);
		fireTableRowsDeleted(index, index);
	}