Repository navigation
feat: inject the http session into use() - #213
Merged
Merged
Conversation
Contributor
Author
Moves session injection into `Browser` and flushes it inline in `use()`, dropping the `afterUse()` hook.
kbond
force-pushed
the
feat-149-http-session-in-use
branch
from
October 10, 2026 14:48
5ea8e47 to
a961544
Compare
Member
|
Thanks @Amoifr, nice work! I pushed a commit on top (and rebased on |
Also skips rewriting the session cookie when its id did not change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #149
Injects the app's http session into
->use(), as sketched in the issue:It works on both
KernelBrowserandPlaywrightBrowser. Playwright routes browser requests through the kernel in the same process, so the container and session storage are shared the same way. The session is loaded from the session cookie when the browser has one, so the id is preserved and nothing the app stored is lost.The session is saved, and its cookie written, when the callback returns. That happens inline in
use(), so no extension hook is needed, and the callback gets the realSessionobject, so flash bags and other bags work as usual.To seed the session before the first visit on Playwright, the cookie jar now falls back to the base url host when the page is still on
about:blank.