support auto get session from input fix #211
Showing
2 changed files
with
5 additions
and
1 deletions
| ... | @@ -270,7 +270,7 @@ func (c *Controller) SaveToFile(fromfile, tofile string) error { | ... | @@ -270,7 +270,7 @@ func (c *Controller) SaveToFile(fromfile, tofile string) error { |
| 270 | 270 | ||
| 271 | func (c *Controller) StartSession() session.SessionStore { | 271 | func (c *Controller) StartSession() session.SessionStore { |
| 272 | if c.CruSession == nil { | 272 | if c.CruSession == nil { |
| 273 | c.CruSession = GlobalSessions.SessionStart(c.Ctx.ResponseWriter, c.Ctx.Request) | 273 | c.CruSession = c.Ctx.Input.CruSession |
| 274 | } | 274 | } |
| 275 | return c.CruSession | 275 | return c.CruSession |
| 276 | } | 276 | } | ... | ... |
| ... | @@ -306,6 +306,10 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) | ... | @@ -306,6 +306,10 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) |
| 306 | context.Output = beecontext.NewOutput(rw) | 306 | context.Output = beecontext.NewOutput(rw) |
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | if SessionOn { | ||
| 310 | context.Input.CruSession = GlobalSessions.SessionStart(w, r) | ||
| 311 | } | ||
| 312 | |||
| 309 | var runrouter *controllerInfo | 313 | var runrouter *controllerInfo |
| 310 | var findrouter bool | 314 | var findrouter bool |
| 311 | 315 | ... | ... |
-
Please register or sign in to post a comment