Updating cookie example for new changed API

This commit is contained in:
Kenneth Shaw 2017-08-21 07:10:42 +07:00
parent b2d9420f0c
commit b6cbbcbe03

View File

@ -72,8 +72,8 @@ func setcookies(host string, res *string) cdp.Tasks {
return cdp.Tasks{
cdp.ActionFunc(func(ctxt context.Context, h cdptypes.Handler) error {
expr := cdptypes.TimeSinceEpoch(time.Now().Add(180 * 24 * time.Hour))
success, err := network.SetCookie(host, "cookiename", "cookievalue").
WithExpirationDate(&expr).
success, err := network.SetCookie("cookiename", "cookievalue").
WithExpires(&expr).
WithDomain("localhost").
WithHTTPOnly(true).
Do(ctxt, h)