new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Playwright · all subjects

authentication/session-storage

1 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Session storage persistence for authentication

Playwright does not provide an API to persist session storage, but session storage can be manually saved and restored. Example for JavaScript: ```js // Get session storage and store as env variable const sessionStorage = await page.evaluate(() => JSON.stringify(sessionStorage)); fs.writeFileSync('playwright/.auth/session.json', sessionStorage, 'utf-8'); // Set session storage in a new context const sessionStorage = JSON.parse(fs.readFileSync('playwright/.auth/session.json', 'utf-8')); await context.addInitScript(storage => { if (window.location.hostname === 'example.com') { for (const [key, value] of Object.entries(storage)) window.sessionStorage.setItem(key, value); } }, sessionStorage); ``` Session storage is domain-specific and not persisted across page loads.

Give your agent this brain