import "github.com/snluu/uuid" func (this *AccountController) CreateSession(uid int64) { sig := uuid.Rand().Hex() maxAge := 3600 * 24 * 30 expired := int(time.Now().Unix()) + maxAge models.SaveSession(uid, sig, expired) this.Ctx.SetCookie("sig", sig, maxAge, "/") }