Get the session object.

@return Gdn_Session
328934
public static function Session() {
      if (is_null(self::$_Session))
         self::$_Session = self::Factory(self::AliasSession);
      return self::$_Session;
   }
687204
protected function getSession()
    {
        if (null === $this->session) {
            throw new \LogicException(sprintf('The deprecated method %s cannot be used when passing a driver in the constructor', __METHOD__));
        }

        @trigger_error(sprintf('The method %s is deprecated as of Mink 1.7 and will be removed in 2.0. Use getDriver and the driver API instead.', __METHOD__), E_USER_DEPRECATED);

        return $this->session;
    }
1228585
public static function get()
	{
		self::checkSessionStarted();

		$res = array();
		if (isset($_SESSION[self::$sessionName]))
		{
			$res = $_SESSION[self::$sessionName];
			unset($_SESSION[self::$sessionName]);
		}

		return $res;
	}
601799
protected function getSessionKeyByOwner()
    {
        if ($this->sessionKey) {
            return $this->sessionKey;
        }

        if ($this->owner instanceof Controller) {
            return $this->owner->module->id;
        }

        return 'generic';
    }
1268539
public function getCurrentSession()
    {
        if (is_null($this->currentSession)) {
            $this->currentSession = $this->mapper->mapFromStorage(
                $this->request($this->buildUrl(new CurrentSession()), 'GET')
            );
        }
        if (!($this->currentSession instanceof CurrentSession)) {
            $this->currentSession = null;
            throw new NotLoggedInException('Authorization required');
        }
        return $this->currentSession;
    }
786479
public function getStorage()
    {
        if (null === $this->storage) {
            $this->setStorage(new Session(get_called_class()));
        }

        return $this->storage;
    }
408285
public function getSession()
    {
        try {
            $session = \PagSeguro\Services\Session::create(
                $this->getPagSeguroCredentials()
            );
            return $session->getResult();
        } catch (\Exception $exception) {
            throw $exception;
        }
    }
866239
public function getSessionClient()
    {
        if (is_null($this->sessionClient)) {
            $this->sessionClient = Client::makeGuzzle($this->sessionEndpoint);
        }

        return $this->sessionClient;
    }
460794
public static function BasketInSession()
    {
        /** @var Request $request */
        $request = \ChameleonSystem\CoreBundle\ServiceLocator::get('request_stack')->getCurrentRequest();

        return $request->getSession()->has(self::SESSION_KEY_NAME);
    }
778115
public function getSessionId()
    {
        if (($sValue = $this->getViewConfigParam('sessionid')) === null) {
            $sValue = $this->getSession()->getId();
            $this->setViewConfigParam('sessionid', $sValue);
        }

        return $sValue;
    }
52658
@Override
    public Session getSession() {
        return state.get() > GlobalState.INITIALISING ? new Session(dataMgr.getSessionDAO().session()) : new Session();
    }
1343974
public function getUser() {
		if (!is_null($this->session)) {
			return $this->session->getUser();
		} else {
			return $this->context->getSystem()->getUser();
		}
	}
520787
public function getConfig()
    {
        $config = parent::getConfig();
        $currentSession = \common_session_SessionManager::getSession();
        if ($currentSession instanceof TaoLtiSession) {
            $launchData = $currentSession->getLaunchData();
            if ($launchData->hasVariable(LtiThemeSwitcher::LTI_VARIABLE)) {
                $config["activeNamespace"] = $launchData->getVariable(LtiThemeSwitcher::LTI_VARIABLE);
            }
        }

        return $config;
    }
1264149
def _get_session():
    """"""
    session = getattr(g, '_session', None)
    if session is None:
        session = g._session = db.session()
    return session
72229
public function getSession() {
        if ($this->debug) { $start = microtime(true); }
        if (!$this->sessionLoaded) {
            $session = null;
            $write_cookie = true;

            $parsed_url = parse_url($this->redirect_uri);
            $parsed_path = '/';
            if (!empty($parsed_url['path'])) {
                $parsed_path = ($parsed_url['path'] != '/')?rtrim($parsed_url['path'], '/'):'/';
            }
            $request_uri = $this->_getServerParam('REQUEST_URI');
            $code = $this->_getRequestParam('code');
            if (!$session && stristr($request_uri,$parsed_path) && $code) {
                $ret = $this->getAccessToken($code);
                if (is_array($ret) && isset($ret['access_token'])) {
                    $session = $this->signSession($ret); // Signs session for security
                }
            }
            // try loading session from signed_request in $_REQUEST
            $signedRequest = $this->getSignedRequest();
            if ($signedRequest) {
                // sig is good, use the signedRequest
                $session = $this->createSessionFromSignedRequest($signedRequest);
            }
            // try loading session from $_REQUEST
            $session_param = $this->_getRequestParam('session');
            if (!$session && $session_param) {
                $session = json_decode(get_magic_quotes_gpc() ? stripslashes($session_param) : $session_param, true);
                $session = $this->validateSessionObject($session);
            }
            // try loading session from cookie if necessary
            if (!$session && $this->useCookieSupport()) {
                $cookieName = $this->getSessionCookieName();
                if (isset($_COOKIE[$cookieName])) {
                    $session = array();
                    parse_str(trim(get_magic_quotes_gpc() ? stripslashes($_COOKIE[$cookieName]) : $_COOKIE[$cookieName], '"'), $session);
                    $session = $this->validateSessionObject($session);
                    // write only if we need to delete a invalid session cookie
                    $write_cookie = empty($session);
                }
            }
            $this->setSession($session, $write_cookie);
        }
        if ($this->debug) { $this->timer[__FUNCTION__]['elapsed'][] = microtime(true)-$start; }
        return $this->session;
    }
935637
protected function proxy() {
        if (!$this->context) {
            $this->context = new SessionContext($this->version, $this->solution['sid']);
        }

        return $this->context;
    }
8105
private function getDwnlCustomer()
    {
        if (is_null($this->cacheDwnlCust)) {
            $custId = $this->session->getCustomerId();
            $this->cacheDwnlCust = $this->daoDwnlCust->getById($custId);
        }
        return $this->cacheDwnlCust;
    }