Sessions & auth
Task-first recipes for sessions & auth.
Reuse a login session
Log in once, save the browser state to a file, and load it into fresh contexts.
Bypass a cookie consent banner
Get past a consent overlay by clicking accept, pre-setting the cookie, or blocking the CMP script.
Set a cookie before navigating
Seed a cookie on the context with addCookies, then load the page in the state you want.
Pass HTTP basic authentication
Set httpCredentials as a context option so protected pages load without a browser prompt.