Updating cookie example for new changed API
This commit is contained in:
parent
b2d9420f0c
commit
b6cbbcbe03
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user