Adds a new session token from the selected parameter. Also notifies the
{@link ExtensionHttpSessions} if it's active.
481266
public void addSessionToken() {
		// Get the selected parameter
		HtmlParameterStats item = this.getParamsPanel().getSelectedParam();
		if (item != null) {
			
			// If the HttpSessions extension is active, notify it of the new session token
			ExtensionHttpSessions extSession = this.getExtensionHttpSessions();
			if (extSession != null) {
				extSession.addHttpSessionToken(this.getParamsPanel().getCurrentSite(), item.getName());
			}
			
			// Flag the item accordingly
			item.addFlag(HtmlParameter.Flags.session.name());
			// Repaint so change shows up
			this.getParamsPanel().getParamsTable().repaint();
		}
	}
786524
public PauseSessionResponse pauseSession(PauseSessionRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        checkStringNotEmpty(request.getSessionId(), "The parameter sessionId should NOT be null or empty string.");
        InternalRequest internalRequest = createRequest(HttpMethodName.PUT, request, LIVE_SESSION,
                request.getSessionId());
        internalRequest.addParameter(PAUSE, null);
        return invokeHttpClient(internalRequest, PauseSessionResponse.class);
    }
265108
@SuppressWarnings("unchecked")
	public void sessionCreated(HttpSessionEvent se) {
		Descriptor<? extends Context> descriptor = container.contexts().get(Session.class);
		
		if (descriptor != null) {
			WebContext<HttpSession> context = (WebContext<HttpSession>) container.component(descriptor);
			context.associate(se.getSession());
		}
	}
684067
public void sessionCreated(final HttpSessionEvent event) {
		counter++;
		final HttpSession session = event.getSession();
		final String id = session.getId();
		SESSIONS.put(id, session);
	}
729045
public void addServletMapping( String servletName, String urlPattern )
    {
        if ( ! urlPattern.endsWith( PageFlowConstants.PAGEFLOW_EXTENSION ) )
        {
            super.addServletMapping( servletName, urlPattern );
        }
    }
197099
public void attachSession(List<ServiceInstanceToken> instanceTokens, final AttachSessionCallback cb, Object context){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.AttachSession);

        String sessionId = connection.getSessionId();
        AttachSessionProtocol protocol = new AttachSessionProtocol(instanceTokens, sessionId);
        ProtocolCallback pcb = new ProtocolCallback(){

            @Override
            public void call(boolean result, Response response,
                    ErrorCode error, Object ctx) {
                Map<ServiceInstanceToken, ItemResult> items = ((AttachSessionResponse)response).getAttachingResult();
                cb.call(result, items, error, ctx);
            }

        };

        connection.submitCallbackRequest(header, protocol, pcb, context);
    }
1373041
public void addAuthToken(ClientRequest request, String token) {
        if(token != null && !token.startsWith("Bearer ")) {
            if(token.toUpperCase().startsWith("BEARER ")) {
                // other cases of Bearer
                token = "Bearer " + token.substring(7);
            } else {
                token = "Bearer " + token;
            }
        }
        request.getRequestHeaders().put(Headers.AUTHORIZATION, token);
    }
668631
def add_request_session(self):
        """"""
        session = new_request_session(self.config, self.cookies)
        self.request_sessions[thread.get_ident()] = session
478385
public void onOpen(WebSocketSession session) {
        WsonrpcRemotes.addRemote(session, wsonrpcControl.getConfig());
        fireOpen(session);
    }
492647
private void initialize() {
		this.addActionListener(new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent e) {
				// Get the HttpSessionsSite
				HttpSessionsPanel panel = extension.getHttpSessionsPanel();
				HttpSessionsSite site = panel.getCurrentHttpSessionSite();
				if (site == null)
					return;

				// Unset the active session, no matter the current selection is, as the popup menu
				// is always only enabled on active session
				site.unsetActiveSession();
			}
		});

	}
616643
@SuppressWarnings("unchecked")
	private void addURL(URL url) throws Exception {
		URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
		Class clazz = URLClassLoader.class;
		Method method = clazz.getDeclaredMethod("addURL", new Class[] { URL.class });
		method.setAccessible(true);
		method.invoke(classLoader, new Object[] { url });
	}
1274070
@Override
    public void onApplicationEvent(HttpSessionDestroyedEvent event) {
        final HttpSession session = ((HttpSessionDestroyedEvent) event).getSession();
        @SuppressWarnings("unchecked")
        final Map<String, PortletSession> portletSessions =
                (Map<String, PortletSession>) session.getAttribute(PORTLET_SESSIONS_MAP);
        if (portletSessions == null) {
            return;
        }

        /*
         * Since (at least) Tomcat 7.0.47, this method has the potential to
         * generate a StackOverflowError because PortletSession.invalidate()
         * will trigger another HttpSessionDestroyedEvent, which means this
         * method will be called again.  I don't know if this behavior is a bug
         * in Tomcat or Spring, if this behavior is entirely proper, or if the
         * reality somewhere in between.
         *
         * For the present, let's put a token in the HttpSession (which is
         * available from the event object) as soon as we start invalidating it.
         * We'll then ignore sessions that already have this token.
         */
        if (session.getAttribute(ALREADY_INVALIDATING_SESSION_ATTRIBUTE) != null) {
            // We're already invalidating;  don't do it again
            return;
        }
        session.setAttribute(ALREADY_INVALIDATING_SESSION_ATTRIBUTE, Boolean.TRUE);

        for (final Map.Entry<String, PortletSession> portletSessionEntry :
                portletSessions.entrySet()) {
            final String contextPath = portletSessionEntry.getKey();
            final PortletSession portletSession = portletSessionEntry.getValue();
            try {
                portletSession.invalidate();
            } catch (IllegalStateException e) {
                this.logger.info(
                        "PortletSession with id '"
                                + portletSession.getId()
                                + "' for context '"
                                + contextPath
                                + "' has already been invalidated.");
            } catch (Exception e) {
                this.logger.warn(
                        "Failed to invalidate PortletSession with id '"
                                + portletSession.getId()
                                + "' for context '"
                                + contextPath
                                + "'",
                        e);
            }
        }
    }
338409
public void sessionCreated(ISession session) {
        HttpSession httpsession = (HttpSessionImpl) _adapter.adapt(session);
        HttpSessionEvent event = new HttpSessionEvent(httpsession);
        HttpSessionListener listener = null;

        // synchronized (_sessionListeners) {
        for (int i = 0; i < _sessionListeners.size(); i++) {
            listener = (HttpSessionListener) _sessionListeners.get(i);
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
                LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "sessionCreated", "Calling sessionCreated on listener:" + listener);
            }
            if (!session.isOverflow()) { //PK85530
                listener.sessionCreated(event);
            }
        }
        // }

    }
904228
@Override
    protected void addHttpSessionIdListeners(ArrayList sessionIdListeners, String j2eeName, SessionContext sessCtx) {
        sessCtx.addHttpSessionIdListener(sessionIdListeners, j2eeName);
    }
883000
public void addEm(String sessionToken, EntityManager em)
    {
        if (emMap == null)
        {
            emMap = new HashMap<String, EntityManager>();
        }
        emMap.put(sessionToken, em);
    }
697601
public void setActiveSession(HttpSession activeSession) {
		if (log.isInfoEnabled()) {
			log.info("Setting new active session for site '" + site + "': " + activeSession);
		}
		if (activeSession == null) {
			throw new IllegalArgumentException(
					"When settting an active session, a non-null session has to be provided.");
		}

		if (this.activeSession == activeSession) {
			return;
		}

		if (this.activeSession != null) {
			this.activeSession.setActive(false);
			// If the active session was one with no tokens, delete it, as it will probably not
			// match anything from this point forward
			if (this.activeSession.getTokenValuesCount() == 0) {
				this.removeHttpSession(this.activeSession);
			} else {
				// Notify the model that the session is updated
				model.fireHttpSessionUpdated(this.activeSession);
			}
		}
		this.activeSession = activeSession;
		activeSession.setActive(true);
		// Notify the model that the session is updated
		model.fireHttpSessionUpdated(activeSession);
	}
407690
OAuth2SessionRef initialiseSessionRef(final String token)
	{
		final OAuth2SessionRef session = sessionRefProvider.get();

		if (!session.hasBeenInitialised())
			session.initialiseFromAPIToken(token);

		return session;
	}