Get session from the store.
@private
438065
function getSession(sessions, sessionId) {
  var sess = sessions[sessionId]

  if (!sess) {
    debug('no session in MemoryStore for %s',sessionId);
    return;
  }

  // parse
  sess = JSON.parse(sess)

  var expires = typeof sess.cookie.expires === 'string' ?
    new Date(sess.cookie.expires) :
    sess.cookie.expires

  // destroy expired session
  if (expires && expires <= Date.now()) {
    debug('Session %s is Expired in MemoryStore',sessionId);
    delete sessions[sessionId];
    return;
  }

  return sess
}
491321
function Session(config, RedisClient) {
      this.config = config;
      this.RedisClient = RedisClient;
      this.storeKey = __bind(this.storeKey, this);
      this.destroy = __bind(this.destroy, this);
      this.remove = __bind(this.remove, this);
      this.get = __bind(this.get, this);
      this.put = __bind(this.put, this);
      this.has = __bind(this.has, this);
      this.id = base64id.generateId();
      this.is_active = true;
    }
1117503
def getReadSession(self):
        '''  '''
        if self.ReadSession is None:
            self.ReadSession=scoped_session(sessionmaker(bind=self.engine))

        return self.ReadSession
226607
def get(self, *args, **kwargs):
        
        return self.session.get(*args, **self.get_kwargs(**kwargs))
1172407
function(key, defaultValue){
            var value = this.get(key, defaultValue);
            if($ExpressSESSION.session.store[key]){
                delete $ExpressSESSION.session.store[key];
            }
            return value;
        }
511815
public function getSession(): ?Session
    {
        if (!$this->hasSession()) {
            $this->setSession($this->getDefaultSession());
        }
        return $this->session;
    }
336817
function Store(name, handler, id) {
    this.setId(id);
    this.__name = name;
    this.__handler = handler;

    /**
     * The session attributes.
     *
     * @var {Object}
     * @protected
     */
    this.__attributes = {};

    /**
     * Session store started status.
     *
     * @var {Boolean}
     */
    this.__started = false;
}
1212413
public IoSession getSession() {
        synchronized (lock) {
            if (sessions.isEmpty()) {
                return null;
            } else {
                final Object[] keys = sessions.keySet().toArray();
                for (int i = 0; i < sessions.size(); i++) { //
                    counter++;
                    final int pos = Math.abs(counter % sessions.size());
                    final IoSession session = sessions.get(keys[pos]);
                    if (isAvailable(session)) {
                        return session;
                    }
                }
                return null;
            }
        }
    }
1286438
function getSession (ctx) {
    let signedCookie = ctx.cookies.get(sessionKey, {signed: cookie.signed}) || ''
    signedCookie = signedCookie.split('.')

    return ctx.thunk()(function () {
      if (!storeAvailable) throw new Error('session store is not available')
      if (signedCookie[0]) return store.get(signedCookie[0])
    })(function (err, session) {
      if (err) throw err
      let sessionId
      let originalHash

      if (session) {
        sessionId = signedCookie[0]
        originalHash = signedCookie[1]
        if (hashSession(session, sessionId) !== originalHash) session = null
      }

      if (!session) {
        session = genSession()
        sessionId = genSid(sidSize)
        originalHash = hashSession(session, sessionId)
      }

      return {
        session: session,
        sessionId: sessionId,
        originalHash: originalHash,
        isNew: originalHash !== signedCookie[1]
      }
    })
  }
65146
function() {
        var user = userStore.getUser();
        if (user) {
          $rootScope.user = user;
          authLogger.log('AuthService.withUser()', user);
          return $q.when(user);
        } else {
          authLogger.log('AuthService.withUser(), calling startLogin()');
          return this.startLogin();
        }
      }
950300
function SessionStorage_construct(config) {
        this.timeouts = {};
        this.config = core.extend(
            {
                cookieKey: 'session_id',
                time: 60 * 20 * 1000, // 20 min default session time
                storage: null,
                key_prefix: 'SESSION_ID_KEY_'
            },
            config
        );

        if (!this.config.storage) {
            this.config.storage = cache;
        } else if (Type.isString(this.config.storage)) {
            this.config.storage = di.load(this.config.storage);
        }

        if(!(this.config.storage instanceof StorageInterface)) {
            throw new error.HttpError(500, this.config, 'Session storage must be instance of interface/storage');
        }
    }
722915
function getResource(storeName, item) {
		var res,
			view = this,
			store = $views[storeName];

		res = store && store[item];
		while ((res === undefined) && view) {
			store = view.tmpl[storeName];
			res = store && store[item];
			view = view.parent;
		}
		return res;
	}
1127769
async function getSession (url) {
  const token = await loadToken(url)
  if (!token) return null
  const header = jwt.decode(token)
  if (!header) return null
  const now = Math.floor(Date.now() / 1000)
  if (header.exp <= now) return null
  return header
}
1154039
function(storeName, cb) {
    var result;
    var transaction = this.transaction(storeName, MODE.READ_ONLY, result, cb);
    var store = this.store(storeName, transaction, cb);
    var request;
    try {
      request = store.count();
    } catch (err) {
      if (isFunction(cb)) return cb(err);
    }
    request.onsuccess = function(event) {
      result = event.target.result;
    };
    request.onerror = function(event) {
      if (isFunction(cb)) return cb(event.target.error);
    };
  }
711283
protected Object getSession(String id, int version, boolean isSessionAccess, boolean forceSessionRetrieval, Object xdCorrelator) {
        if (isSessionAccess) {
            if (version == -1) {
                _store.refreshSession(id, xdCorrelator);
            } else {
                _store.refreshSession(id, version, xdCorrelator);
            }
        }

        ISession iSession = getSessionFromStore(id, version, isSessionAccess, forceSessionRetrieval, xdCorrelator);
        if (iSession != null) {
            if (isSessionAccess) {
                boolean stillValid = _store.checkSessionStillValid(iSession, iSession.getLastAccessedTime());
                if (stillValid) {
                    iSession.incrementRefCount();
                    _sessionEventDispatcher.sessionAccessed(iSession);
                } else {
                    iSession = null;
                }
            }
        } else {
            if (isSessionAccess) {
                _sessionEventDispatcher.sessionAccessUnknownKey(id);
            }
        }
        return iSession;
    }
230524
def __get_session(self):
        
        db_path = self.__get_config().get(ConfigKeys.asset_allocation_database_path)
        self.session = dal.get_session(db_path)
        return self.session
1360827
def _get(self, name):
        
        return self._stores.get(name, self._resolve(name))