How to Persist a Cookie: Use Browserbase's context persistence feature to persist across multiple sessions.
- Clone this repository
- Install dependencies:
npm install
- Create a
.env
file and add your Browserbase Project ID and API Key (accessible here: https://www.browserbase.com/settings) - Run:
tsc -w
- Run:
node dist/index.js
- A Browserbase account with API access
- Node.js (v14 or higher recommended)
- Creates a Browserbase context
- Starts a first browserbase session with this context
- Sets and verifies a cookie
- Closes the first session
- Starts a second browserbase session with this same context
- Verifies that the cookies persists between sessions