单个的Session:
package memoryproviderimport ( "time")type SessionStore struct { sid string timeAccessed time.Time infoColl map[interface{}]interface{} }func (st *SessionStore) Set(key, value interface{}) error { st.infoColl[key] = value providerInstance().SessionUpdate(st.sid) return nil}func (st *SessionStore) Get(key interface{}) interface{} { providerInstance().SessionUpdate(st.sid) if v, ok := st.infoColl[key]; ok { return v } else { return nil } return nil}func (st *SessionStore) Delete(key interface{}) error { delete(st.infoColl, key) providerInstance().SessionUpdate(st.sid) return nil}func (st *SessionStore) SessionID() string { return st.sid}