Skip to content
lighthouse
Menu

Login helper · @houses/lighthouse-login-helpers

injectSessionCookies

Set cookies from a real, human-completed login instead of driving the form (Session injection).

await injectSessionCookies(page, cookies);

Sets the given cookies on the page before navigation. Capture them once from a login a person completed, then pass them in.

Meant for production behind CAPTCHA or Turnstile, where scripting the login is unreliable and against the CAPTCHA provider’s terms.