func update(ctx *web.Context) { if ctx.Params["submit"] == "Delete" { ctx.SetCookie(web.NewCookie(cookieName, "", -1)) } else { ctx.SetCookie(web.NewCookie(cookieName, ctx.Params["cookie"], 0)) } ctx.Redirect(301, "/") }
func CheckAuthKeyCookie(ctx *web.Context, subscriber *Subscriber) bool { return true if len(subscriber._subscriberKey) == 0 { key, _ := uuid.NewV4() ctx.SetCookie(web.NewCookie("SubscriberKey", key.String(), 0)) fmt.Println(key) subscriber._subscriberKey = key.String() return true } if key, err := ctx.Request.Cookie("SubscriberKey"); err == nil { return key.Value == subscriber._subscriberKey } else { fmt.Println(err) } return false }