1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 02:30:55 +00:00

fix: added nil check on c.CruSession to prevent crash

This commit is contained in:
Jared Folkins 2014-02-26 16:44:31 -08:00
parent a38a4f0343
commit 47d7ac06b7

View File

@ -397,7 +397,9 @@ func (c *Controller) DelSession(name interface{}) {
// SessionRegenerateID regenerates session id for this session.
// the session data have no changes.
func (c *Controller) SessionRegenerateID() {
if c.CruSession != nil {
c.CruSession.SessionRelease(c.Ctx.ResponseWriter)
}
c.CruSession = GlobalSessions.SessionRegenerateId(c.Ctx.ResponseWriter, c.Ctx.Request)
c.Ctx.Input.CruSession = c.CruSession
}