/* (non-Javadoc)
@see jcifs.smb.SmbExtendedAuthenticator#sessionSetup(jcifs.smb.SmbSession, jcifs.smb.ServerMessageBlock, jcifs.smb.ServerMessageBlock)
426438
public void sessionSetup(
            final SmbSession session, 
            final ServerMessageBlock andx, 
            final ServerMessageBlock andxResponse) throws SmbException {
        try {
            Subject.doAs(subject, new PrivilegedExceptionAction(){
                public Object run() throws Exception{
                    setup(session, andx, andxResponse);
                    return null;
                }
            });
        } catch (PrivilegedActionException e) {
            if (e.getException() instanceof SmbException) {
                throw (SmbException) e.getException();
            }
            throw new SmbException(e.getMessage(), e.getException());
        }
    }
1121294
@Override
	protected final void remoteInit() throws JMSException
    {
        CreateDurableSubscriberQuery query = new CreateDurableSubscriberQuery();
        query.setSessionId(session.getId());
        query.setConsumerId(id);
        query.setTopic((Topic)destination);
        query.setMessageSelector(messageSelector);
        query.setNoLocal(noLocal);
        query.setName(subscriptionName);
        transportEndpoint.blockingRequest(query);
    }
402374
@Override
    public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc, JingleSession jingleSession) throws NotConnectedException, InterruptedException {
        if (lc instanceof ICECandidate) {
            if (((ICECandidate) lc).getType().equals(Type.relay)) {
                RTPBridge rtpBridge = RTPBridge.relaySession(lc.getConnection(), lc.getSessionId(), lc.getPassword(), rc, lc);
            }
        }
    }
197645
@Override
	public synchronized QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
    {
        checkNotClosed();
        
        RemoteQueueSession session = new RemoteQueueSession(idProvider.createID(),
        		                                            this,
        		                                            transportHub.createEndpoint(),
        		                                            transacted,
        		                                            acknowledgeMode);
        registerSession(session);
        session.remoteInit();
        return session;
    }
1276376
@SuppressWarnings("unchecked")
    private void initSession(SMTPClientSession session) {
        Iterator<SMTPDeliveryEnvelope> transactionList = ((Iterator<SMTPDeliveryEnvelope>) session.getAttribute(SMTP_TRANSACTIONS_KEY));
        SMTPDeliveryEnvelope transaction =  transactionList.next();
        
        session.setAttribute(CURRENT_SMTP_TRANSACTION_KEY,transaction);
        session.setAttribute(RECIPIENTS_KEY, transaction.getRecipients().iterator());
        session.setAttribute(DELIVERY_STATUS_KEY, new ArrayList<DeliveryRecipientStatus>());

        // cleanup old attribute
        session.setAttribute(CURRENT_RCPT_KEY, null);

    }
165883
@Override
    public void sessionCreated(NextFilter nextFilter, IoSession session)
            throws Exception {
        for (Map.Entry<String, Object> e : attributes.entrySet()) {
            session.setAttribute(e.getKey(), e.getValue());
        }

        nextFilter.sessionCreated(session);
    }
781766
synchronized void renewSession(String prevSessionToken)
  throws SFException, SnowflakeSQLException
  {
    if (sessionToken != null &&
        !sessionToken.equals(prevSessionToken))
    {
      logger.debug("not renew session because session token has not been updated.");
      return;
    }

    SessionUtil.LoginInput loginInput = new SessionUtil.LoginInput();
    loginInput.setServerUrl(
        (String) connectionPropertiesMap.get(SFSessionProperty.SERVER_URL))
        .setSessionToken(sessionToken)
        .setMasterToken(masterToken)
        .setIdToken(idToken)
        .setLoginTimeout(loginTimeout)
        .setDatabaseName(this.getDatabase())
        .setSchemaName(this.getSchema())
        .setRole(this.getRole())
        .setWarehouse(this.getWarehouse());

    SessionUtil.LoginOutput loginOutput = SessionUtil.renewSession(loginInput);

    if (loginOutput.isUpdatedByTokenRequestIssue())
    {
      setCurrentObjects(loginInput, loginOutput);
    }
    sessionToken = loginOutput.getSessionToken();
    masterToken = loginOutput.getMasterToken();
  }
575683
void removeSession(JmsSessionImpl sess) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "removeSession", sess);

        synchronized (stateLock) {
            // Remove the Session
            // Note that this is a synchronized collection.
            boolean res = sessions.remove(sess);

            // Release the ordering context associated with the session
            unusedOrderingContexts.add(sess.getOrderingContext());

            if (!res && TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "session not found in list");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "removeSession");
    }
756082
public void updateSessionManagement(Boolean sessionManagement) throws SecurityException {
	checkWriteAccess();
	boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);

	if (!hasAccess) throw new SecurityException("no access to update scope setting");

	Element scope = _getRootElement("scope");
	scope.setAttribute("sessionmanagement", Caster.toString(sessionManagement, ""));
    }
942602
public void sessionUserNameSet(ISession session, String oldUserName, String newUserName) {
        _sessionStateEventDispatcher.sessionUserNameSet(session, oldUserName, newUserName);

    }
757638
protected void startSession()throws SocksException{
	   
	   System.out.println("Session: " + proxyHost + ":" + proxyPort);
       try{
         if(chainProxy == null)
            proxySocket = new Socket(proxyIP,proxyPort);
         else if(proxyIP != null)
            proxySocket = new SocksSocket(chainProxy,proxyIP,proxyPort);
         else
            proxySocket = new SocksSocket(chainProxy,proxyHost,proxyPort);

         in = proxySocket.getInputStream();
         out = proxySocket.getOutputStream();
       }catch(SocksException se){
         throw se;
       }catch(IOException io_ex){
         throw new SocksException(SOCKS_PROXY_IO_ERROR,""+io_ex);
       }
   }
541300
private void updateSession(final LinkedHashMap<String, XMLObject> messages) {
        context.getSessionStore().set(context, SAML_STORAGE_KEY, messages);
    }
1088586
private function initSessionConfig():void
    {
        if (!defined("IUMIO_ENV")) {
            throw new Server500(new \ArrayObject(array("explain" => "Framework Environment is not defined",
                "solution" => "Please initialize the framework environment")));
        }
        if (false === Server::exist(IUMIO_ROOT."/elements/cache/".strtolower(IUMIO_ENV)."/sessions")) {
            Server::create(IUMIO_ROOT."/elements/cache/".
                strtolower(IUMIO_ENV)."/sessions", "directory");
        }

        $this->id = session_id();
        $this->name = session_name();
        if (!$this->isStarted()) {
            session_save_path(IUMIO_ROOT . '/elements/cache/' . strtolower(IUMIO_ENV) . '/sessions');
            ini_set('session.gc_probability', 1);
        }
    }
730094
protected void remoteInit() throws JMSException
    {
        CreateBrowserQuery query = new CreateBrowserQuery();
        query.setBrowserId(id);
        query.setSessionId(session.getId());
        query.setQueue(queue);
        query.setMessageSelector(messageSelector);
        transportEndpoint.blockingRequest(query);
    }
999599
protected function setUpSession () {
		if ($this->session === NULL) {
			$sessionClass = $this->application->GetSessionClass();
			$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
			$this->session = $sessionClass::GetNamespace($selfClass);
			$this->session->SetExpirationSeconds($this->sessionExpirationSeconds);
		}
	}
1375007
private void newHttpSessionScope() {
        SessionScopeAdvisor advisor = SessionScopeAdvisor.create(context);
        this.sessionScope = new HttpSessionScope(advisor);
        setAttribute(SESSION_SCOPE_ATTRIBUTE_NAME, this.sessionScope);
    }
1315591
public void setSessions(java.util.Collection<Session> sessions) {
        if (sessions == null) {
            this.sessions = null;
            return;
        }

        this.sessions = new com.amazonaws.internal.SdkInternalList<Session>(sessions);
    }