mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 16:50:54 +00:00
support auto get session from input fix #211
This commit is contained in:
parent
048be29fcd
commit
4a3d32dc1f
@ -270,7 +270,7 @@ func (c *Controller) SaveToFile(fromfile, tofile string) error {
|
|||||||
|
|
||||||
func (c *Controller) StartSession() session.SessionStore {
|
func (c *Controller) StartSession() session.SessionStore {
|
||||||
if c.CruSession == nil {
|
if c.CruSession == nil {
|
||||||
c.CruSession = GlobalSessions.SessionStart(c.Ctx.ResponseWriter, c.Ctx.Request)
|
c.CruSession = c.Ctx.Input.CruSession
|
||||||
}
|
}
|
||||||
return c.CruSession
|
return c.CruSession
|
||||||
}
|
}
|
||||||
|
@ -306,6 +306,10 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
|||||||
context.Output = beecontext.NewOutput(rw)
|
context.Output = beecontext.NewOutput(rw)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if SessionOn {
|
||||||
|
context.Input.CruSession = GlobalSessions.SessionStart(w, r)
|
||||||
|
}
|
||||||
|
|
||||||
var runrouter *controllerInfo
|
var runrouter *controllerInfo
|
||||||
var findrouter bool
|
var findrouter bool
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user