func Sessions(name string, store Store) martini.Handler {
	return func(res http.ResponseWriter, r *http.Request, c martini.Context, l *log.Logger) {
		s := &session{name, r, l, store, nil, false}
		c.MapTo(s, (*Session)(nil))
		rw := res.(martini.ResponseWriter)
		rw.Before(func(martini.ResponseWriter) {
			if s.Written() {
				check(s.Session().Save(r, res), l)
			}
		})
		defer context.Clear(r)
		c.Next()
	}
}
Sessions is a Middleware that maps a session.Session service into the Martini handler chain.
Sessions can use a number of storage solutions with the given store.
package sessions
import (
	"github.com/go-martini/martini"
	"github.com/gorilla/context"
	"github.com/gorilla/sessions"
	"log"
	"net/http"
)
const (
	errorFormat = "[sessions] ERROR! %s\n"
)
type Store interface {
	sessions.Store
}
type Options struct {
	Path   string
	Domain string
	MaxAge   int
	Secure   bool
	HttpOnly bool
}
type Session interface {
	Get(key interface{}) interface{}
	Set(key interface{}, val interface{})
	Delete(key interface{})
	Clear()
	AddFlash(value interface{}, vars ...string)
	Flashes(vars ...string) []interface{}
	Options(Options)
}