Commit 4a3d32dc authored by astaxie's avatar astaxie

support auto get session from input fix #211

parent 048be29f
......@@ -270,7 +270,7 @@ func (c *Controller) SaveToFile(fromfile, tofile string) error {
func (c *Controller) StartSession() session.SessionStore {
if c.CruSession == nil {
c.CruSession = GlobalSessions.SessionStart(c.Ctx.ResponseWriter, c.Ctx.Request)
c.CruSession = c.Ctx.Input.CruSession
}
return c.CruSession
}
......
......@@ -306,6 +306,10 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
context.Output = beecontext.NewOutput(rw)
}
if SessionOn {
context.Input.CruSession = GlobalSessions.SessionStart(w, r)
}
var runrouter *controllerInfo
var findrouter bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment