Skip to main content
Log in to a site once in Zenrows Browser, the browser for agents, save the session state to a file, and load it into every new browser session. Your scripts and agents skip the login form on later runs, which makes them faster and keeps the number of logins low. Uses: Browser with Playwright’s storage_state, and the MCP tools browser_get_cookies / browser_set_cookies

Ask your AI agent

With the Zenrows MCP server connected, paste this prompt. Your agent picks the right Zenrows tools and settings on its own.
To reuse the login later, ask the agent to “open a new Zenrows browser session with the same cookies” before it visits the protected page.

Log in and save the session state

Automate logins only for accounts you own or are authorized to use, and follow the site’s terms.
The demo login at scrapingcourse.com/login accepts admin@example.com / password. After you submit the form, wait for an element that appears after the login (here, the “Welcome” banner), then save the state with storage_state. The file holds cookies and local storage.
Waiting for a post-login element is the reliable signal for any login form: it confirms the credentials worked, whatever redirects the site runs in between.

Reuse the session in a new browser

Open a new browser session, create a context from auth.json, and go straight to the protected page.

Example output

The saved auth.json holds the site’s cookies, including the login session:

Customize it

Troubleshooting

  • page.click waits until it times out after submitting the form: Playwright is waiting for the navigation to settle. Click with no_wait_after=True (noWaitAfter: true in Node.js) and wait for an element of the logged-in page instead.
  • The second session lands on the login page: the saved session expired or the site ties it to an IP. Log in again to refresh auth.json, and use the same proxy_country on both sessions.
  • auth.json has no session cookie: the state was saved before the login finished. Save it after the post-login element appears.
auth.json grants access to the account. Store it like a password: keep it out of version control and share it with the processes that need it.

Fill and submit multi-step forms

Type, select and submit, then verify the result on the page.

Connect Playwright or Puppeteer to Zenrows Browser

The connection URL and its country, region and lifetime options.

Let your AI assistant browse with Browser tools

Log in, click and read pages from Claude, Cursor or the CLI.

Keep the same IP and submit forms

Reuse an IP and submit forms with Fetch, no browser needed.