// Clear all sessions from the store. Requires the use of a key
// prefix in the store options, otherwise the method refuses to delete all keys.
769653
func (this *RedisStore) Clear() error {
	vals, err := this.getSessionKeys()
	if err != nil {
		return err
	}
	if len(vals) > 0 {
		this.conn.Send("MULTI")
		for _, v := range vals {
			this.conn.Send("DEL", v)
		}
		_, err = this.conn.Do("EXEC")
		if err != nil {
			return err
		}
	}
	return nil
}
789073
func (s *Store) Clear() {
	s.Lock()
	defer s.Unlock()

	if s.protected {
		return
	}

	for _, savedFuture := range s.store {
		savedFuture.Cancel()
	}

	s.store = make(map[packet.ID]*Future)
}
1346357
func (m *SecureMap) Clear() {
	m.lock.Lock()
	m.data = make(map[interface{}]interface{})
	m.lock.Unlock()
}
1344552
func (s *session) Clear(table string) error {
	action, err := s.clear(table)
	if err != nil {
		return s.catch("Clear "+table+": "+action, err)
	}
	return nil
}
117738
func (k KeybaseServiceMeasured) ClearCaches(ctx context.Context) {
	k.delegate.ClearCaches(ctx)
}
155933
func (s *EventStore) Clear(ctx context.Context) error {
	if err := s.session.DB(s.dbName(ctx)).C("events").DropCollection(); err != nil {
		return eh.EventStoreError{
			BaseErr:   err,
			Err:       ErrCouldNotClearDB,
			Namespace: eh.NamespaceFromContext(ctx),
		}
	}
	return nil
}
1086287
func (s *State) clear() {
	*s = State{Inputs: s.Inputs, vars: s.vars}
	s.vars.ClearValues()
}
99386
func (p *SessionStore) Delete(key string) error {
	p.Lock()
	defer p.Unlock()
	delete(p.values, key)
	return nil
}
445012
func (m *MemoryStorer) Clean() {
	t := time.Now().UTC()
	m.mut.Lock()
	for id, session := range m.sessions {
		if t.After(session.expires) {
			delete(m.sessions, id)
		}
	}
	m.mut.Unlock()
}
465523
func (s *Session) Delete(key string) bool {
	removed := s.provider.db.Delete(s.sid, key)
	if removed {
		s.mu.Lock()
		s.isNew = false
		s.mu.Unlock()
	}

	return removed
}
764987
func (u *User) DeleteSessions(db *sqlx.DB) error {
	q := `DELETE FROM sessions WHERE userid=$1`
	_, err := db.Exec(q, u.ID)
	if err != nil && err != sql.ErrNoRows {
		return err
	}
	return nil
}
209336
func (e *Echo) Clear(middleware ...interface{}) {
	if len(middleware) > 0 {
		for _, dm := range middleware {
			var decr int
			for i, m := range e.middleware {
				if m != dm {
					continue
				}
				i -= decr
				start := i + 1
				if start < len(e.middleware) {
					e.middleware = append(e.middleware[0:i], e.middleware[start:]...)
				} else {
					e.middleware = e.middleware[0:i]
				}
				decr++
			}
		}
	} else {
		e.middleware = []interface{}{}
	}
	e.head = nil
}
1363207
func (s *Session) ClearFlashes() {
	s.mu.Lock()
	for key := range s.flashes {
		delete(s.flashes, key)
	}
	s.mu.Unlock()
}
1236355
func (c *Cluster) RemoveStore(storeID uint64) {
	c.Lock()
	defer c.Unlock()

	delete(c.stores, storeID)
}
1344245
func (s *memcacheStore) Close() {
	// Flush out sessions that were accessed from this store. No need locking, we're closing...
	// We could use Codec.SetMulti(), but sessions will contain at most 1 session like all the times.
	for _, sess := range s.sessions {
		s.setMemcacheSession(sess)
	}

	if s.onlyMemcache {
		return // Don't save to Datastore
	}

	if s.asyncDatastoreSave {
		go s.saveToDatastore()
	} else {
		s.saveToDatastore()
	}
}
1054869
func (p *SessionStore) Flush() error {
	p.Lock()
	defer p.Unlock()
	p.values = make(map[string]interface{})
	return nil
}
899628
func (st *Store) Cleanup() {
	st.e.Where("expires_unix < ?", util.TimeStampNow()).Delete(&xormSession{tableName: st.opts.TableName})
}