gernest / utron

A lightweight MVC framework for Go(Golang)
MIT License
2.22k stars 149 forks source link

Does (*context.Context) GetSession return new session intentionally? #102

Open tomocy opened 5 years ago

tomocy commented 5 years ago

I found the code below in session.go and I wonder this because gorilla/sessions has a method (Store) Get to retrieve a session with a given name.

//GetSession retrieves session with a given name.
func (ctx *Context) GetSession(name string) (*sessions.Session, error) {
    if ctx.SessionStore != nil {
        return ctx.SessionStore.New(ctx.Request(), name)
    }
    return nil, errNoStore
}