@param string $sessionId

@return bool
434281
public function destroy($sessionId): bool
    {
        $filename = $this->savePath . \DIRECTORY_SEPARATOR . $this->prefix . $sessionId;
        if (\file_exists($filename)) {
            \unlink($filename);
        }

        return true;
    }
973398
public function write($sessionid, $sessiondata)
    {
        $wasWritten = !(file_put_contents("{$this->savePath}{$sessionid}.txt", $sessiondata) === false);

        if (!$wasWritten) {
            // maybe there's no folder on file system?

            if (!is_dir($this->savePath)) {
                Directory::mkdir($this->savePath, 0755);
                $wasWritten = !(file_put_contents("{$this->savePath}{$sessionid}.txt", $sessiondata) === false);
            }
        }

        return $wasWritten;
    }
969186
public function destroy($sessionID): bool
    {
        $file = $this->savePath.DIRECTORY_SEPARATOR.'sess_'.$sessionID;
        $ret = \file_exists($file) ? @\unlink($file) : true;
        return $ret;
    }
1238800
public function destroy($session_id)
	{
		if (!xcache_isset($this->key($session_id)))
		{
			return true;
		}

		return xcache_unset($this->key($session_id));
	}
1205404
public function do_destroy($session_id)
    {
        /** @var \ManaPHP\DbInterface $db */
        $db = $this->_di->getShared($this->_db);

        $db->delete($this->_source, ['session_id' => $session_id]);

        return true;
    }
655890
public function session_write($sessionId, $sessionData)
    {
        $sessionData       = (!$sessionData || !is_array($sessionData)) ? [] : $sessionData;
        $this->sessionData = (!$this->sessionData) ? [] : $this->sessionData;

        $this->sessionData = array_merge($sessionData, $this->sessionData);
        $this->engine->set($this->sessionKey . $sessionId, $this->sessionData, $this->sessionLifeTime);

        return true;
    }
262764
public function read($sessionId): string
    {
        $sql = 'SELECT content FROM sessions WHERE id = :id';
        $params = ['id' => $sessionId];

        return (string) $this->db->selectVar($sql, $params);
    }
1068163
private static function setSessionId($sessionId){
        $sessionId = trim($sessionId);

        // 非法字符处理
        if (!$sessionId || preg_match("/[^0-9a-z_\\-\\,]/i", $sessionId)) {
            return false;
        }

        $sessionId = substr($sessionId, 0, 40);
        session_id($sessionId);

        return $sessionId;
    }
258233
public function getAttemptsLeftWithSameSession(string $sessionId): int
    {
        $attemptsLeft = ((int) $this->maxAttemptsForSessionId) - $this->enhancedAuthenticationMapper->fetchAttemptsWithSameSession($sessionId, $this->banTimeInSeconds);

        return \max(0, $attemptsLeft);
    }
145816
public function read($sessionId)
    {
        if ($this->get_lock($sessionId) !== false) {
            // Needed by write() to detect session_regenerate_id() calls
            if (!$this->_session_id) {
                $this->_session_id = $sessionId;
            }
            $query = $this->newQuery()
                ->select('timestamp', 'data')
                ->where('id', $sessionId);

            if ($this->_config['match_ip']) {
                $query->where('ip_address', $_SERVER['REMOTE_ADDR']);
            }

            if (($result = $query->first()) === null) {
                // PHP7 will reuse the same SessionHandler object after
                // ID regeneration, so we need to explicitly set this to
                // false instead of relying on the default ...
                if ($this->_session_id === $sessionId) {
                    $this->row_exists = false;
                }
                $this->_fingerprint = md5('');
                return '';
            }

            $this->row_exists = true;

            if ($result->timestamp < (time() - $this->_config['expiration'])) {
                $this->_fingerprint = md5('');
                return '';
            }
            $result = $result->data;
            $this->_fingerprint = md5($result);
            return $result;
        }
        $this->_fingerprint = md5('');
        return '';
    }
664962
public function read($sessionId): string
    {
        $filename = $this->savePath . \DIRECTORY_SEPARATOR . $this->prefix . $sessionId;
        if (\file_exists($filename)) {
            return (string) \file_get_contents($filename);
        }

        return '';
    }
478136
protected function doWrite($sessionId, $data)
    {
        $item = $this->getCacheItem($sessionId);
        $item->set($data)
            ->expiresAfter($this->ttl);

        return $this->cache->save($item);
    }
974988
public function touchAction($sessionId) {
		if ($this->request->getHttpRequest()->getMethod() !== 'POST') {
			$this->response->setStatus(405);
			$this->response->setHeader('Allow', 'POST');
			return;
		}

		$session = $this->sessionManager->getSession($sessionId);
		if ($session !== NULL) {
			$session->touch();

			if ($this->ssoLogger !== NULL) {
				$this->ssoLogger->log('Touched session "' . $sessionId . '"' , LOG_DEBUG);
			}

			$this->view->assign('value', array('success' => TRUE));
		} else {
			$this->response->setStatus(404);

			$this->view->assign('value', array('error' => 'SessionNotFound'));
		}
	}
302994
function delete_session($sessionid) {
        try {
            $param = new \Panopto\SessionManagement\DeleteSessions($this->auth, array($sessionid));
            $this->smclient->DeleteSessions($param);
        } catch (Exception $e) {
            throw new SoapFault('client', $e->getMessage());
        }
        return true;
    }
1307751
protected function lockSession($sessionId)
    {
        $attempts = (1000000 / $this->spinLockWait) * $this->lockMaxWait;

        $this->token = uniqid();
        $this->lockKey = $this->getRedisKey($sessionId).'.lock';

        $setFunction = function ($redis, $key, $token, $ttl) {
            if ($redis instanceof \Redis) {
                return $redis->set(
                    $key,
                    $token,
                    array('NX', 'PX' => $ttl)
                );
            }

            return $redis->set(
                $key,
                $token,
                'PX',
                $ttl,
                'NX'
            );
        };

        for ($i = 0;$i < $attempts;++$i) {

            // We try to aquire the lock
            $success = $setFunction($this->redis, $this->lockKey, $this->token, $this->lockMaxWait * 1000 + 1);
            if ($success) {
                $this->locked = true;

                return true;
            }

            usleep($this->spinLockWait);
        }

        return false;
    }
377457
public function destroy($sessionId)
    {
        parent::destroy($sessionId);
        if (isset($_COOKIE[$this->cookieKeyName])) {
            setcookie($this->cookieKeyName, '', 1);
            unset($_COOKIE[$this->cookieKeyName]);
        }
        return true;
    }
780233
function get_session_by_id($sessionid) {
        try {
            $param = new \Panopto\SessionManagement\GetSessionsById($this->auth, array($sessionid));
            $sessions = $this->smclient->GetSessionsById($param)->getGetSessionsByIdResult()->getSession();
        } catch (Exception $e) {
            return false;
        }
        if (count($sessions)) {
            return $sessions[0];
        }
        return false;
    }