Start your pulling live session by live session id.

@param sessionId Live session id.
@return the response
541720
public StartPullSessionResponse startPullSession(String sessionId) {
        StartPullSessionRequest request = new StartPullSessionRequest().withSessionId(sessionId);
        return startPullSession(request);
    }
1063988
public function touch(string $sessionId)
    {
        $key = "{$this->sessionName}_{$sessionId}";
        if (yield $this->redis->exists($key)) {
            return $this->redis->expire($key, $this->getConfig()->get('session.maxLifeTime', 1440));
        } else {
            return $this->redis->set($key, '{}',
                $this->getConfig()->get('session.maxLifeTime', 1440));
        }
    }
627947
public StartRecordingResponse startRecording(String sessionId, String recording) {
        checkStringNotEmpty(sessionId, "The parameter sessionId should NOT be null or empty string.");
        checkStringNotEmpty(recording, "The parameter recording should NOT be null or empty string.");
        StartRecordingRequest request = new StartRecordingRequest().withSessionId(sessionId);
        InternalRequest internalRequest = createRequest(HttpMethodName.PUT, request, LIVE_SESSION, sessionId);
        internalRequest.addParameter(RECORDING, recording);
        return invokeHttpClient(internalRequest, StartRecordingResponse.class);
    }
78792
@Override
    public Session get(String id) throws Exception {
        Session session;
        Exception ex = null;

        while (true) {
            session = doGet(id);

            if (sessionDataStore == null) {
                break; // can't load any session data so just return null or the session object
            }

            if (session == null) {
                if (log.isDebugEnabled()) {
                    log.debug("Session " + id + " not found locally, attempting to load");
                }

                // didn't get a session, try and create one and put in a placeholder for it
                PlaceHolderSession phs = new PlaceHolderSession (new SessionData(id, 0, 0, 0, 0));
                Lock phsLock = phs.lock();
                Session s = doPutIfAbsent(id, phs);
                if (s == null) {
                    // My placeholder won, go ahead and load the full session data
                    try {
                        session = loadSession(id);
                        if (session == null) {
                            // session does not exist, remove the placeholder
                            doDelete(id);
                            phsLock.close();
                            break;
                        }

                        try (Lock ignored = session.lock()) {
                            // swap it in instead of the placeholder
                            boolean success = doReplace(id, phs, session);
                            if (!success) {
                                // something has gone wrong, it should have been our placeholder
                                doDelete(id);
                                session = null;
                                log.warn("Replacement of placeholder for session " + id + " failed");
                                phsLock.close();
                                break;
                            } else {
                                // successfully swapped in the session
                                session.setResident(true);
                                session.updateInactivityTimer();
                                phsLock.close();
                                break;
                            }
                        }
                    } catch (Exception e) {
                        ex = e; // remember a problem happened loading the session
                        doDelete(id); // remove the placeholder
                        phsLock.close();
                        session = null;
                        break;
                    }
                } else {
                    // my placeholder didn't win, check the session returned
                    phsLock.close();
                    try (Lock ignored = s.lock()) {
                        // is it a placeholder? or is a non-resident session? In both cases, chuck it away and start again
                        if (!s.isResident() || s instanceof PlaceHolderSession) {
                            continue;
                        }
                        session = s;
                        break;
                    }
                }
            } else {
                // check the session returned
                try (Lock ignored = session.lock()) {
                    // is it a placeholder? or is it passivated? In both cases, chuck it away and start again
                    if (!session.isResident() || session instanceof PlaceHolderSession) {
                        continue;
                    }

                    // got the session
                    break;
                }
            }
        }

        if (ex != null) {
            throw ex;
        }

        return session;
    }
1073117
public static synchronized I18N getInstance(String sessionId) {
        if (!sessionInstances.containsKey(sessionId)) {
            sessionInstances.put(sessionId, new DefaultI18N());
        }
        return sessionInstances.get(sessionId);
    }
393110
public function session($session_id)
	{
		$query = $this->connection->getQuery()
			->select('*')
			->from('#__session')
			->group('userid')
			->group('client_id')
			->order('time', 'desc');

		$this->connection->setQuery($query->toString());
		return $this->connection->loadObject();
	}
108885
public HttpSessionImpl getSession(final String sessionId) {
        final SessionManager sessionManager = deployment.getSessionManager();
        Session session = sessionManager.getSession(sessionId);
        if (session != null) {
            return SecurityActions.forSession(session, this, false);
        }
        return null;
    }
1285822
protected function setSessionId($sessionId, $validateSessionId = true)
    {

        if ($validateSessionId) {
            if (!$this->sessionIdIsValid($sessionId)) {
                $sessionId = false;
            }
        }

        if (!$sessionId) {
            $sessionId = $this->generateSessionId();
        }

        $this->session_id = $sessionId;

        // Not relying on session to retrieve it's ID from the cookie
        session_id($sessionId);

        // Will set cookie automatically anyway, let's try to control it
        session_set_cookie_params(
            self::$config['cookie']['lifetime'],
            self::$config['cookie']['path'],
            self::$config['cookie']['domain'],
            self::$config['cookie']['secureOnly'],
            self::$config['cookie']['httpOnly']
        );

        session_name(self::$config['cookie']['name']);
    }
964587
@Override
    public RTMPConnection getConnectionBySessionId(String sessionId) {
        log.debug("Getting connection by session id: {}", sessionId);
        if (connMap.containsKey(sessionId)) {
            return connMap.get(sessionId);
        } else {
            log.warn("Connection not found for {}", sessionId);
            if (log.isTraceEnabled()) {
                log.trace("Connections ({}) {}", connMap.size(), connMap.values());
            }
        }
        return null;
    }
326026
public GetSessionResponse getSessionWithToken(String sessionId, Integer timeoutInMinute) {
        GetSessionResponse getSessionResponse = getSession(sessionId);
        if (timeoutInMinute == null) {
            return getSessionResponse;
        }
        DateTime dateTime = new DateTime(DateTimeZone.UTC);
        DateTime expireTime = dateTime.plusMinutes(timeoutInMinute);
        DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss'Z'");
        String expire = formatter.print(expireTime);

        GetSecurityPolicyResponse getSecurityPolicyResponse = getSecurityPolicy(getSessionResponse.getSecurityPolicy());
        Map<String, String> hlsUrls = new HashMap<String, String>();
        Map<String, String> rtmpUrls = new HashMap<String, String>();
        Map<String, String> flvUrls = new HashMap<String, String>();
        if (getSecurityPolicyResponse.getAuth().getPlay()) {
            if (getSessionResponse.getPlay().getHlsUrls() != null) {
                for (Map.Entry<String, String> entry : getSessionResponse.getPlay().getHlsUrls().entrySet()) {
                    String line = entry.getKey();
                    String hlsUrl = entry.getValue();
                    if (hlsUrl != null) {
                        String hlsToken = null;
                        if (line.equals("L0")) {
                            hlsToken = LssUtils.hmacSha256(
                                    String.format("/%s/live.m3u8;%s", sessionId, expire),
                                    getSecurityPolicyResponse.getAuth().getKey());
                        } else {
                            hlsToken = LssUtils.hmacSha256(
                                    String.format("/%s-%s/live.m3u8;%s", sessionId, line, expire),
                                    getSecurityPolicyResponse.getAuth().getKey());
                        }
                        if (hlsUrl.lastIndexOf('?') == -1) {
                            hlsUrl += String.format("?token=%s&expire=%s", hlsToken, expire);
                        } else {
                            hlsUrl += String.format("&token=%s&expire=%s", hlsToken, expire);
                        }
                        hlsUrls.put(line, hlsUrl);
                    }
                }

                getSessionResponse.getPlay().setHlsUrls(hlsUrls);
            } else if (getSessionResponse.getPlay().getHlsUrl() != null) {
                String hlsUrl = getSessionResponse.getPlay().getHlsUrl();
                String hlsToken = LssUtils.hmacSha256(
                        String.format("/%s/live.m3u8;%s", sessionId, expire),
                        getSecurityPolicyResponse.getAuth().getKey());
                if (hlsUrl.lastIndexOf('?') == -1) {
                    hlsUrl += String.format("?token=%s&expire=%s", hlsToken, expire);
                } else {
                    hlsUrl += String.format("&token=%s&expire=%s", hlsToken, expire);
                }

                getSessionResponse.getPlay().setHlsUrl(hlsUrl);
            }

            if (getSessionResponse.getPlay().getRtmpUrls() != null) {
                for (Map.Entry<String, String> entry : getSessionResponse.getPlay().getRtmpUrls().entrySet()) {
                    String line = entry.getKey();
                    String rtmpUrl = entry.getValue();
                    if (rtmpUrl != null) {
                        String rtmpToken = LssUtils.hmacSha256(
                                String.format("%s;%s", sessionId, expire),
                                getSecurityPolicyResponse.getAuth().getKey());
                        rtmpUrl += String.format("?token=%s&expire=%s", rtmpToken, expire);
                    }
                    rtmpUrls.put(line, rtmpUrl);
                }

                getSessionResponse.getPlay().setRtmpUrls(rtmpUrls);
            } else if (getSessionResponse.getPlay().getRtmpUrl() != null) {
                String rtmpUrl = getSessionResponse.getPlay().getRtmpUrl();
                String rtmpToken = LssUtils.hmacSha256(
                        String.format("%s;%s", sessionId, expire),
                        getSecurityPolicyResponse.getAuth().getKey());
                rtmpUrl += String.format("?token=%s&expire=%s", rtmpToken, expire);

                getSessionResponse.getPlay().setRtmpUrl(rtmpUrl);
            }

            if (getSessionResponse.getPlay().getFlvUrls() != null) {
                for (Map.Entry<String, String> entry : getSessionResponse.getPlay().getFlvUrls().entrySet()) {
                    String line = entry.getKey();
                    String flvUrl = entry.getValue();
                    if (flvUrl != null) {
                        String flvToken = LssUtils.hmacSha256(
                                String.format("%s;%s", flvUrl, expire),
                                getSecurityPolicyResponse.getAuth().getKey());
                        flvUrl += String.format("?token=%s&expire=%s", flvToken, expire);
                    }
                    flvUrls.put(line, flvUrl);
                }

                getSessionResponse.getPlay().setFlvUrls(flvUrls);
            } else if (getSessionResponse.getPlay().getFlvUrl() != null) {
                String flvUrl = getSessionResponse.getPlay().getFlvUrl();
                String flvToken = LssUtils.hmacSha256(
                        String.format("%s;%s", flvUrl, expire),
                        getSecurityPolicyResponse.getAuth().getKey());
                flvUrl += String.format("?token=%s&expire=%s", flvToken, expire);

                getSessionResponse.getPlay().setFlvUrl(flvUrl);

            }
        }

        if (getSecurityPolicyResponse.getAuth().getPush()) {
            String pushUrl = getSessionResponse.getPublish().getPushUrl();
            String pushToken = LssUtils.hmacSha256(
                    String.format("%s;%s", getSessionResponse.getPublish().getPushStream(), expire),
                    getSecurityPolicyResponse.getAuth().getKey());
            pushUrl += String.format("?token=%s&expire=%s", pushToken, expire);
            getSessionResponse.getPublish().setPushUrl(pushUrl);
        }

        return getSessionResponse;
    }
757436
public ISession createSession(String sessionId, boolean newId) {
        //create local variable - JIT performance improvement
        final boolean isTraceOn = com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled();
        //need some way to checkForDuplicateCreatedIds or synchronize on some object or something ... look at in-memory
        if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINER)) {
            StringBuffer sb = new StringBuffer("id = ").append(sessionId).append(appNameForLogging);
            LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[CREATE_SESSION], sb.toString());
        }
        if (inProcessOfStopping) {
            throwException("SessionContext.createWhenStop");
        }
        BackedSession session = null;
        session = createSessionObject(sessionId);
        session.updateLastAccessTime(session.getCreationTime());
        session.setInsert(); // flag new session for insertion into store
        session.setMaxInactiveInterval((int) _smc.getSessionInvalidationTime());
        session.setUserName(ANONYMOUS_USER);
        _sessions.put(sessionId, session);
        //        if (session.duplicateIdDetected) { // could happen on zOS if key is defined incorrectly - perhaps doesn't include appname
        //                                           // other than that, this really should never happen - duplicate ids should not be generated
        //            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.WARNING, methodClassName, methodNames[CREATE_SESSION], "Store.createSessionIdAlreadyExists");
        //            session = null;
        //        }

        if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINER)) {
            LoggingUtil.SESSION_LOGGER_WAS.exiting(methodClassName, methodNames[CREATE_SESSION], "session = " + session);
        }
        return session;
    }
645280
public static FtpMessage connect(String sessionId) {
        ConnectCommand cmd = new ConnectCommand();
        cmd.setSignal("OPEN");
        cmd.setSessionId(sessionId);
        return new FtpMessage(cmd);
    }
1238126
public function setSessionId($session_id=null)
    {
        $this->session_id= ($session_id!== null) ? $session_id : null;

        return $this;
    }
889104
public RefreshSessionResponse refreshSession(String sessionId) {
        RefreshSessionRequest request = new RefreshSessionRequest();
        request.setSessionId(sessionId);
        return refreshSession(request);
    }
696846
public ResumeSessionResponse resumeSession(ResumeSessionRequest 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(RESUME, null);
        return invokeHttpClient(internalRequest, ResumeSessionResponse.class);
    }
1034803
@Programmatic
    public SessionLogEntry findBySessionId(final String sessionId) {
        return repositoryService.firstMatch(
                new QueryDefault<>(SessionLogEntry.class,
                        "findBySessionId",
                        "sessionId", sessionId));
    }
14648
@Override
	public synchronized USER remove(final ID sessionId)
	{
		sessionIdToSession.remove(sessionId);
		return super.remove(sessionId);
	}