Get current session tokens, if there are any.

@return void
481676
protected function initialize()
    {
        if ($this->initialized) {
            // Already initialized
            return true;
        }

        if (session_status() !== PHP_SESSION_NONE) {

            if (isset($_SESSION[$this->key]) && is_array($_SESSION[$this->key])) {
                // Get the token collection from the session, if we got any
                $this->tokens = $_SESSION[$this->key];
            }

            $this->initialized = true;

        } else {

            throw new CsrfSessionException('A session must be started before the Csrf library can be used');

        }
    }
1071735
public function getCurrentSessionUserInfo()
    {
        $ts = $this->config->table_sessions;
        $tu = $this->config->table_users;

        $query = "
		SELECT {$ts}.uid, {$ts}.expiredate, {$ts}.ip, {$tu}.email, {$tu}.username
		FROM {$ts}, {$tu}
		WHERE hash = :hash AND {$ts}.uid = {$tu}.id";

        $query = $this->dbh->prepare($query);
        $query->execute([
            'hash'	=>	$this->getCurrentSessionHash()
        ]);

        if ($query->rowCount() == 0) {
            return false;
        }

        return $query->fetch(\PDO::FETCH_ASSOC);
    }
739289
def _get_at_from_session(self):
        
        try:
            return self.request.session['oauth_%s_access_token'
                                        % get_token_prefix(
                                            self.request_token_url)]
        except KeyError:
            raise OAuthError(
                _('No access token saved for "%s".')
                % get_token_prefix(self.request_token_url))
916637
private function performTokenInitialization()
    {
        if (!empty($_COOKIE[$this->sessionCookieName])) {
            $this->sessionToken = $_COOKIE[$this->sessionCookieName];

            if (preg_match('#[a-f0-9]{40}#', $this->sessionToken)) {
                return;
            }
        }

        $this->sessionToken = sha1(uniqid('slabphp', true));

        if (headers_sent()) {
            if ($this->log) {
                $this->log->critical('Failed to save session cookie, headers already sent.');
            }
            return;
        }

        if (!setcookie(
            $this->sessionCookieName,
            $this->sessionToken,
            !empty($this->sessionExpiration) ? (time() + $this->sessionExpiration) : 0,
            $this->sessionCookiePath,
            $this->sessionCookieDomain,
            $this->sessionCookieSecure
        )) {
            if ($this->log) {
                $this->log->critical('Failed to save session cookie!');
            }
        }
    }
586716
public function current()
    {
        reset($this->session[$this->prefix]);

        return array_shift($this->session[$this->prefix]);
    }
1297746
protected function get_stored_token() {
        if ($this->system) {
            $token = access_token::get_record(['issuerid' => $this->issuer->get('id')]);
            if ($token !== false) {
                return $token->to_record();
            }
            return null;
        }

        return parent::get_stored_token();
    }
620160
protected function getToken()
    {
        $temp = $this->request->session()->get('oauth.temp');

        return $this->server->getTokenCredentials(
            $temp, $this->request->get('oauth_token'), $this->request->get('oauth_verifier')
        );
    }
285651
public static function getToken()
    {
        $token = self::getSessionToken();
        if (is_null($token)) {
            $nonce = self::generateNonce();
            self::setSessionToken($nonce);

        // Handle old tokens (< 2.6.0)
        } elseif (is_array($token)) {
            $nonce = key($token);
            self::setSessionToken($nonce);

        // New style tokens
        } else {
            $nonce = $token;
        }

        return $nonce;
    }
1011131
public function clearAllTokens()
	{
		$session = $this->getSession();
		foreach ($session as $key => $value) {
			if (strpos($key, self::SESSION_TOKEN_PREFIX) === 0) {
				$session->remove($key);
			}
		}
		return $this;
	}
255124
private function getTokens()
    {
        $tokenVector = array(
            'query' => array(),
        );
        $tokenVector['query'] = $this->tokenizer->getTokenVector();
        $tokens = $this->applyFilters($tokenVector);
        if (!empty($tokens)) {
            $tokens = array_keys($tokens['query']);
        }

        return $tokens;
    }
779781
public function token()
    {
        if (empty($this->csrfToken) && !is_null($this->session)) {
            $this->csrfToken = $this->session->token();
        }

        return $this->hidden('_token', $this->csrfToken);
    }
347132
function() {
      if (this.options.applevel === true || this.options.applevel === false) return this.options.applevel;
      return this.options.session_token == null;
    }
782547
protected function getTokens()
    {
        if ($this->tokens === null) {
            $this->tokens = $this->parsePattern($this->pattern);
        }

        return $this->tokens;
    }
388914
private function addTokens() {
      $headers = [];
      if ($this->appToken !== null) {
         $headers['App-Token'] = $this->appToken;
      }
      if ($this->sessionToken !== null) {
         $headers['Session-Token'] = $this->sessionToken;
      }

      return $headers;
   }
440925
public function check()
    {
        if($this->session->get('token') === $this->request->input('token') || $this->session->get('token') === $this->request->header('X-CSRF-TOKEN')) {
            return true;
        }

        return false;
    }
431460
protected function getCsrfToken(): ?string
    {
        if (is_null($this->csrfToken)) {
            $this->csrfToken = $this->app->make('session')->token();
        }

        return $this->csrfToken;
    }
1242474
public function getCurrentData()
        {
            $current_data = $this->session->getValue($this->key_name);

            return isset($current_data) ? $current_data : $current_data = array();
        }