// GetSession get session by id
961037
func (s *Server) GetSession(id interface{}) IOSession {
	m := s.sessionMaps[getHash(id)%DefaultSessionBucketSize]
	m.RLock()
	session := m.sessions[id]
	m.RUnlock()
	return session
}
897476
func (handle *ContextHandle) GetSession() (session mPkcs11.SessionHandle) {
	handle.lock.RLock()
	select {
	case session = <-handle.sessions:
		logger.Debugf("Reusing existing pkcs11 session %+v on slot %d\n", session, handle.slot)

	default:

		// cache is empty (or completely in use), create a new session
		s, err := handle.OpenSession()
		if err != nil {
			handle.lock.RUnlock()
			panic(fmt.Errorf("OpenSession failed [%s]", err))
		}
		logger.Debugf("Created new pkcs11 session %+v on slot %d\n", s, handle.slot)
		session = s
		cachebridge.ClearSession(fmt.Sprintf("%d", session))
	}
	handle.lock.RUnlock()
	return handle.validateSession(session)
}
830307
func (p *SessionStore) Get(key string) interface{} {
	p.RLock()
	defer p.RUnlock()
	if v, ok := p.values[key]; ok {
		return v
	}
	return nil
}
1203334
func Get(id string, params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) {
	return getC().Get(id, params)
}
935215
func (l *AuditLog) GetSessionChunk(namespace string, sid session.ID, offsetBytes, maxBytes int) ([]byte, error) {
	if l.UploadHandler != nil {
		if err := l.downloadSession(namespace, sid); err != nil {
			return nil, trace.Wrap(err)
		}
	}
	var data []byte
	for {
		out, err := l.getSessionChunk(namespace, sid, offsetBytes, maxBytes)
		if err != nil {
			if err == io.EOF {
				return data, nil
			}
			return nil, trace.Wrap(err)
		}
		data = append(data, out...)
		if len(data) == maxBytes || len(out) == 0 {
			return data, nil
		}
		maxBytes = maxBytes - len(out)
		offsetBytes = offsetBytes + len(out)
	}
}
781946
func (this *MemoryStore) Get(id string) (*Session, error) {
	this.l.RLock()
	defer this.l.RUnlock()
	return this.m[id], nil
}
174517
func (t *SessionTimers) Get(id string) *time.Timer {
	t.RLock()
	defer t.RUnlock()
	return t.m[id]
}
1124925
func (s *Session) Get(key string) interface{} {
	return s.provider.db.Get(s.sid, key)
}
168565
func (s *Session) GetBytes(ctx context.Context, key string) []byte {
	val := s.Get(ctx, key)
	b, ok := val.([]byte)
	if !ok {
		return nil
	}
	return b
}
1232388
func (s *Session) GetString(key string) string {
	r, _ := s.Get(key).(string)
	return r
}
1162648
func (s *Session) Get(args *structs.SessionSpecificRequest,
	reply *structs.IndexedSessions) error {
	if done, err := s.srv.forward("Session.Get", args, args, reply); done {
		return err
	}

	return s.srv.blockingQuery(
		&args.QueryOptions,
		&reply.QueryMeta,
		func(ws memdb.WatchSet, state *state.Store) error {
			index, session, err := state.SessionGet(ws, args.Session)
			if err != nil {
				return err
			}

			reply.Index = index
			if session != nil {
				reply.Sessions = structs.Sessions{session}
			} else {
				reply.Sessions = nil
			}
			if err := s.srv.filterACL(args.Token, reply); err != nil {
				return err
			}
			return nil
		})
}
609198
func getSessionFile(sid string) (string, *probe.Error) {
	sessionDir, err := getSessionDir()
	if err != nil {
		return "", err.Trace()
	}

	sessionFile := filepath.Join(sessionDir, sid+".json")
	return sessionFile, nil
}
84167
func getSessionDataFile(sid string) (string, *probe.Error) {
	sessionDir, err := getSessionDir()
	if err != nil {
		return "", err.Trace()
	}

	sessionDataFile := filepath.Join(sessionDir, sid+".data")
	return sessionDataFile, nil
}
1314216
func (kv *consulKV) getActiveSession(key string) (string, error) {
	pair, _, err := kv.client.Get(key, nil)
	if err != nil {
		return "", err
	}
	if pair != nil && pair.Session != "" {
		return pair.Session, nil
	}
	return "", nil
}
722691
func (c *Connector) GetSessionData(ctx context.Context) (*SessionData, error) {
	s := pitaya.GetSessionFromCtx(ctx)
	res := &SessionData{
		Data: s.GetData(),
	}
	return res, nil
}
157121
func (s *SessionService) FindSession(ctx context.Context, key string) (*platform.Session, error) {
	return s.FindSessionFn(ctx, key)
}
360770
func (s *Session) GetData() map[string]interface{} {
	s.RLock()
	defer s.RUnlock()

	return s.data
}