mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 08:00:57 +00:00
Merge pull request #510 from jfolkins/fix_sessregenid
fix: added nil check on c.CruSession to prevent crash
This commit is contained in:
commit
edb8bac5bc
@ -397,7 +397,9 @@ func (c *Controller) DelSession(name interface{}) {
|
|||||||
// SessionRegenerateID regenerates session id for this session.
|
// SessionRegenerateID regenerates session id for this session.
|
||||||
// the session data have no changes.
|
// the session data have no changes.
|
||||||
func (c *Controller) SessionRegenerateID() {
|
func (c *Controller) SessionRegenerateID() {
|
||||||
c.CruSession.SessionRelease(c.Ctx.ResponseWriter)
|
if c.CruSession != nil {
|
||||||
|
c.CruSession.SessionRelease(c.Ctx.ResponseWriter)
|
||||||
|
}
|
||||||
c.CruSession = GlobalSessions.SessionRegenerateId(c.Ctx.ResponseWriter, c.Ctx.Request)
|
c.CruSession = GlobalSessions.SessionRegenerateId(c.Ctx.ResponseWriter, c.Ctx.Request)
|
||||||
c.Ctx.Input.CruSession = c.CruSession
|
c.Ctx.Input.CruSession = c.CruSession
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user