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{ return cdp.Tasks{
cdp.ActionFunc(func(ctxt context.Context, h cdptypes.Handler) error { cdp.ActionFunc(func(ctxt context.Context, h cdptypes.Handler) error {
expr := cdptypes.TimeSinceEpoch(time.Now().Add(180 * 24 * time.Hour)) expr := cdptypes.TimeSinceEpoch(time.Now().Add(180 * 24 * time.Hour))
success, err := network.SetCookie(host, "cookiename", "cookievalue"). success, err := network.SetCookie("cookiename", "cookievalue").
WithExpirationDate(&expr). WithExpires(&expr).
WithDomain("localhost"). WithDomain("localhost").
WithHTTPOnly(true). WithHTTPOnly(true).
Do(ctxt, h) Do(ctxt, h)