func (this *MemoryStore) Clear() error {
	this.l.Lock()
	defer this.l.Unlock()
	this.newMap()
	return nil
}
Clear all sessions from the store.
package handlers
import (
	"sync"
	"time"
)
type SessionStore interface {
	Get(id string) (*Session, error)  
	Set(sess *Session) error          
	Delete(id string) error           
	Clear() error                     
	Len() int                         
}
type MemoryStore struct {
	l    sync.RWMutex
	m    map[string]*Session
	capc int
}
func NewMemoryStore(capc int) *MemoryStore {
	m := &MemoryStore{}
	m.capc = capc
	m.newMap()
	return m
}
func (this *MemoryStore) Len() int {
	return len(this.m)
}
func (this *MemoryStore) Get(id string) (*Session, error) {
	this.l.RLock()
	defer this.l.RUnlock()
	return this.m[id], nil
}
func (this *MemoryStore) Set(sess *Session) error {
	this.l.Lock()
	defer this.l.Unlock()
	this.m[sess.ID()] = sess
	if sess.IsNew() {
		sess.isNew = false
		wait := sess.MaxAge()
		if wait == 0 {
			wait = 2 * 24 * time.Hour
		}
		go func() {
			<-time.After(wait)
			this.Delete(sess.ID())
		}()
	}
	return nil
}
func (this *MemoryStore) Delete(id string) error {
	this.l.Lock()
	defer this.l.Unlock()
	delete(this.m, id)
	return nil
}