utron icon indicating copy to clipboard operation
utron copied to clipboard

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

Open tomocy opened this issue 6 years ago • 0 comments

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
}

tomocy avatar Oct 19 '18 10:10 tomocy