예제 #1
0
/*
NewSessionHolder creates a new postgres-backed session holder
*/
func NewSessionHolder(db *sql.DB) (base.SessionHolder, error) {
	_, err := db.Exec(TABLE_DEFINITION)
	if err != nil {
		return nil, err
	}

	return &SessionHolder{
		BaseSessionHolder: base.NewBaseSessionHolder(DEFAULT_SESSION_TIMEOUT),
		db:                db,
	}, nil
}
예제 #2
0
/*
NewSessionHolder creates a new redis-backed gob-encoded session holder
*/
func NewSessionHolder() base.SessionHolder {
	return &SessionHolder{
		BaseSessionHolder: base.NewBaseSessionHolder(DEFAULT_SESSION_TIMEOUT),
	}
}