aws / aws/bedrock-agentcore-sdk-python
Browser profile restores cookie but not localStorage across sessions in two regions
- Dominant language
- Python
- Stars
- 761
- Forks
- 147
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 7
Description
**Describe the behavior**
A Browser Profile created for the AWS-managed `aws.browser.v1` Browser restores a persistent cookie into a new profiled session, but does not restore a localStorage item from the same exact HTTPS origin. The result reproduced in both `eu-central-1` and `us-west-2` using identical client bytes.
I am trying to determine whether an additional documented lifecycle step is required, whether this is a known limitation, or whether it is unexpected service behavior.
**Minimal synthetic sequence**
1. Create one Browser Profile.
2. Start one unprofiled `aws.browser.v1` source session.
3. Navigate to exact `https://example.com`.
4. Set one persistent cookie and one localStorage item with synthetic values.
5. Reload the page and verify both values from the exact same origin.
6. Wait 500 ms, verify the origin again, then disconnect the local Playwright CDP client while leaving the AgentCore session active.
7. Call `SaveBrowserSessionProfile` exactly once.
8. Verify the Save response binds the exact profile, Browser, and source session. Poll `GetBrowserProfile` until `READY` with `lastSavedBrowserId` and `lastSavedBrowserSessionId` matching that source.
9. Stop the source session.
10. Start a new `aws.browser.v1` session with the exact saved profile and verify the profile configuration through session readback.
11. Navigate once to exact `https://example.com` and read the same page at cumulative 0, 5, 15, 30, and 60 seconds without renavigation.
At every restore checkpoint the final origin remained exact. The cookie was present at 0 seconds. The localStorage item was absent at every checkpoint through 60 seconds.
The same result occurred in Frankfurt and Oregon. The test used no custom Browser, enterprise policy, proxy, extension, model, or retailer content.
Both sessions were stopped after each run. All test-created stack, profile, and IAM resources were absent, and no reserved READY sessions remained, across ten repeated post-run checks in each region.
**Expected behavior**
The current Browser Profile documentation says that profile save/load captures and restores cookies and local storage. I expected the localStorage item from the verified source origin to be available in the new profiled session, as the cookie was.
Could you confirm:
- whether localStorage persistence is supported for `aws.browser.v1` in both regions;
- whether any additional flush, disconnect, Save, readiness, or restore sequence is required; and
- whether this is a known issue or limitation?
**Environment**
- `bedrock-agentcore` 1.21.0
- `boto3` 1.43.35
- `botocore` 1.43.35
- Playwright 1.62.0
- Python 3.12.3
- Linux x86_64
No account IDs, resource identifiers, request IDs, session IDs, credentials, signed URLs, or raw payloads are included here. I can provide private identifiers and UTC windows through an appropriate private AWS channel if needed.
Contributor guide
Research direction
No repository file or test is identified. Start by reviewing Browser Profile save/load documentation and the SaveBrowserSessionProfile and GetBrowserProfile flow, then rerun the minimal Playwright sequence in eu-central-1 and us-west-2. Done means confirming support for localStorage restoration, identifying any required lifecycle step, or documenting the limitation or service defect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, playwright, python
- Domain
- backend-api-design, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100