// login user func LoginUser(user *User, c *beego.Controller, remember bool) { // weird way of beego session regenerate id... c.CruSession = beego.GlobalSessions.SessionRegenerateId(c.Ctx.ResponseWriter, c.Ctx.Request) c.Ctx.Input.CruSession = c.CruSession sess := c.StartSession() sess.Set("auth_user_id", user.Id) }