Get a session secret, a secret should never be exposed publicly

@return  string  The session token
173244
public function getSecret()
    {
        if ($this->secret === null)
        {
            $salt = $this->_createSalt(12);
            $name = session_name();

            $this->secret = sha1($salt . $name);
        }

        return $this->secret;
    }
574310
public function GetCsrf () {
		$session = & $this->getSession();
		list($name, $value) = $session->csrf;
		return (object) ['name' => $name, 'value' => $value];
	}
423252
private function getSigningSecret()
    {
        $secret = $this->getConsumerSecret().'&';

        if (null !== $token_secret = $this->getTokenSecret()) {
            $secret .= $token_secret;
        }

        return $secret;
    }
1272238
protected function generateToken() {
		$session = $this->getSession();
		if($session->has('_csrf_token'))
			return $session['_csrf_token'];
		else {
			$token = \Asgard\Common\Tools::randstr();
			return $session['_csrf_token'] = $token;
		}
	}
44670
public function getOauthAccessToken(){
        $code = isset($_GET['code'])?$_GET['code']:'';
        if (!$code) return false;
        $result = $this->http_get(self::API_BASE_URL_PREFIX.self::OAUTH_TOKEN_URL.'appid='.$this->appid.'&secret='.$this->appsecret.'&code='.$code.'&grant_type=authorization_code');
        if ($result)
        {
            $json = json_decode($result,true);
            if (!$json || !empty($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            $this->user_token = $json['access_token'];
            return $json;
        }
        return false;
    }
342120
private function getToken()
    {
        if (!$token = $this->storage->get('access_token')) {
            if (!$token = $this->storage->get('request_token')) {
                $token = new \stdClass();
                $token->oauth_token = null;
                $token->oauth_token_secret = null;
            }
        }
        return $token;
    }
87935
public function actionAsyncToken()
    {
        if (($lockout = $this->sessionBruteForceLock())) {
            return $this->sendArray(false, [Module::t('login_async_submission_limit_reached', ['time' =>  Yii::$app->formatter->asRelativeTime($lockout)])]);
        }
        
        $secureToken = Yii::$app->request->post('secure_token', false);
        
        $model = new LoginForm();
        $model->secureTokenExpirationTime = $this->module->secureTokenExpirationTime;
        
        if ($secureToken) {
            $user = $model->validateSecureToken($secureToken, Yii::$app->session->get('secureId'));

            if ($user && Yii::$app->adminuser->login($user)) {
                Yii::$app->session->remove('secureId');
                return $this->sendArray(true);
            }
            
            return $this->sendArray(false, [Module::t('login_async_token_error')]);
        }

        return $this->sendArray(false, [Module::t('login_async_token_globalerror')]);
    }
873965
public function getSessionChallengeToken()
    {
        if (\OxidEsales\Eshop\Core\Registry::getSession()->isSessionStarted()) {
            $sessionChallengeToken = $this->getSession()->getSessionChallengeToken();
        } else {
            $sessionChallengeToken = "";
        }

        return $sessionChallengeToken;
    }
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')
        );
    }
614856
public function generateCsrfToken() {
		$token = hash("sha512", mt_rand(0, mt_getrandmax()));
		$_SESSION[$this->csrfTokenSessionKey] = $token;
		return $token;
	}
868793
public function getSessionKey(): ?string
    {
        $cacheKey = 'sessionkey';
        if (!isset(self::$cache[$cacheKey])) {
            $cookies = Internal\Cookies::getList(Internal\Cookies::TYPE_SERVER);
            $cookieKey = '_s';
            $key = isset($cookies[$cookieKey]) ? (string) $cookies[$cookieKey] : '';
            self::$cache[$cacheKey] = strlen((string) $key) > 70 ? $key : null;
        }
        return self::$cache[$cacheKey];
    }
1262665
public function getSessionNotOnOrAfter()
    {
        $notOnOrAfter = null;
        $entries = $this->_queryAssertion('/saml:AuthnStatement[@SessionNotOnOrAfter]');
        if ($entries->length !== 0) {
            $notOnOrAfter = OneLogin_Saml2_Utils::parseSAML2Time($entries->item(0)->getAttribute('SessionNotOnOrAfter'));
        }
        return $notOnOrAfter;
    }
207877
public function getTokens()
    {
        $pool = null;
        $session = \PHPSession::singleton();
        if($session->hasAttribute(self::TOKEN_KEY)){
            $pool = $session->getAttribute(self::TOKEN_KEY);
        }
        if(is_null($pool)){
            $pool = [];
        }

        return $pool;
    }
669492
private function checkAuth()
    {
        $namespace = explode('\\', $this->getModelTableMap());
        $module = strtolower($namespace[0]);
        $secret = Config::getInstance()->get($module . '.api.secret');
        if (NULL === $secret) {
            $secret = Config::getInstance()->get("api.secret");
        }
        if (NULL === $secret) {
            $auth = TRUE;
        } else {
            $token = Request::getInstance()->getHeader('X-API-SEC-TOKEN');
            if (array_key_exists('API_TOKEN', $this->query)) {
                $token = $this->query['API_TOKEN'];
            }
            $auth = SecurityHelper::checkToken($token ?: '', $secret, $module);
        }

        return $auth || $this->isAdmin();
    }
32747
protected function getOAuthToken() {
        # TODO: use session to store the token
        if ($this->client_id and $this->client_secret) {
            $response = $this->httpQuery(
                'POST', 'https://orcid.org/oauth/token',
                [
                    'Accept' => 'application/json',
                    'Content-Type' => 'application/x-www-form-urlencoded'
                ],
                http_build_query([
                  'client_id' => $this->client_id,
                  'client_secret' => $this->client_secret,
                  'scope' => '/read-public',
                  'grant_type' => 'client_credentials',
                ])
            );

            if ($response) {
                return $response->{'access_token'};
            }
        }
    }
1069547
public function getAccessToken() {
        if (!empty($this->accessToken)) {
            return $this->accessToken;
        }
        $accessToken = $this->sessionStorage->read('access_token');
        if (!empty($accessToken)) {
            $this->accessToken = $accssToken;
            return $this->accessToken;
        }

        $this->exchangeToken();

        return $this->accessToken;
    }
1005723
public function hiddenSid()
    {
        $sSid = $sToken = '';
        if ($this->isSidNeeded()) {
            $sSid = "<input type=\"hidden\" name=\"" . $this->getForcedName() . "\" value=\"" . $this->getId() . "\" />";
        }
        if ($this->getId()) {
            $sToken = "<input type=\"hidden\" name=\"stoken\" value=\"" . $this->getSessionChallengeToken() . "\" />";
        }

        return $sToken . $sSid;
    }