// MongoSession mocks base method
348047
func (m *MockState) MongoSession() *mgo_v2.Session {
	ret := m.ctrl.Call(m, "MongoSession")
	ret0, _ := ret[0].(*mgo_v2.Session)
	return ret0
}
590651
func (mr *MockAccessRequesterMockRecorder) SetSession(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSession", reflect.TypeOf((*MockAccessRequester)(nil).SetSession), arg0)
}
471028
func (s *AdminInitiateAuthOutput) SetSession(v string) *AdminInitiateAuthOutput {
	s.Session = &v
	return s
}
457282
func (service *Service) GetSession(request *http.Request, kind SessionType, name string) (*sessions.Session, error) {
	return service.Sessions[kind].Get(request, name)
}
258541
func NewSessionRecord() *SessionRecord {
	ss := &protobuf.SessionStructure{}
	record := &SessionRecord{sessionState: &sessionState{ss},
		Fresh: true,
	}
	return record
}
281835
func (c *Conn) LockSession(id string) {
	c.object.Call(dbusInterface+".LockSession", 0, id)
}
204407
func MongoDB(ctx context.Context) (*mgo.Session, bool) {
	key := mongodb(mongoDBName)
	session, ok := ctx.Value(key).(*mgo.Session)
	return session, ok
}
486950
func (sm *Manager) UserSession(ctx context.Context) (*types.UserSession, error) {
	var mgr mo.SessionManager

	pc := property.DefaultCollector(sm.client)
	err := pc.RetrieveOne(ctx, sm.Reference(), []string{"currentSession"}, &mgr)
	if err != nil {
		// It's OK if we can't retrieve properties because we're not authenticated
		if f, ok := err.(types.HasFault); ok {
			switch f.Fault().(type) {
			case *types.NotAuthenticated:
				return nil, nil
			}
		}

		return nil, err
	}

	return mgr.CurrentSession, nil
}
262181
func (s *VerifySoftwareTokenInput) SetSession(v string) *VerifySoftwareTokenInput {
	s.Session = &v
	return s
}
306837
func (s *Event) SetSession(v *Session) *Event {
	s.Session = v
	return s
}
373357
func GetSession() (*mgo.Session, error) {
	var err error

	if mgoSession == nil {
		mgoSession, err = mgo.Dial(servers)
		if err != nil {
			return nil, err
		}
	}

	return mgoSession.Clone(), nil
}
1317725
func NewSession() *Session {
	s := &Session{
		IdleTimeout: 0,
		Lifetime:    24 * time.Hour,
		Store:       memstore.New(),
		contextKey:  generateContextKey(),
		Cookie: SessionCookie{
			Name:     "session",
			Domain:   "",
			HttpOnly: true,
			Path:     "/",
			Persist:  true,
			Secure:   false,
			SameSite: http.SameSiteLaxMode,
		},
	}
	return s
}
14367
func newSession(parentCtx context.Context, c *asticontext.Canceller, d *dispatcher, i *identifier, w *writer) *Session {
	return &Session{object: newObject(parentCtx, c, d, i, w, i.new())}
}
254134
func (s *ssProvider) openSession() (*dbus.Object, error) {
	var disregard dbus.Variant
	var sessionPath dbus.ObjectPath
	method := fmt.Sprint(ssServiceIface, "OpenSession")
	err := s.srv.Call(method, 0, "plain", dbus.MakeVariant("")).Store(&disregard, &sessionPath)
	if err != nil {
		return nil, err
	}
	return s.Object(ssServiceName, sessionPath), nil
}
309064
func (auth *Auth) CreateSession(w http.ResponseWriter, user User) error {
	session := auth.sessions.Create(user)
	if !session.Exists() {
		return fmt.Errorf("auth: could not create new session")
	}
	SetCookie(w, auth.config.Cookie, session)
	return nil
}
219701
func WithSession(ctx context.Context, session *Session) context.Context {
	return context.WithValue(ctx, sessionKey, session)
}
875095
func newSession(maxAge int) *Session {
	uid, err := uuid.NewV4()
	if err != nil {
		panic(ErrNoSessionID)
	}
	return &Session{
		true, // is new
		internalSession{
			make(map[string]interface{}),
			uid.String(),
			time.Now(),
			time.Duration(maxAge) * time.Second,
		},
	}
}