diff --git a/controller.go b/controller.go index 9bd68ae8..9d783747 100644 --- a/controller.go +++ b/controller.go @@ -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() { - 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.Ctx.Input.CruSession = c.CruSession }