Using the Playground
This guide explains how to use the cookie playground infrastructure.
Accessing the Playground
After deployment, access the playground at:
- Parent Domain:
https://cookie-playground.pun7o.click - Subdomain A:
https://site-a.cookie-playground.pun7o.click - Subdomain B:
https://site-b.cookie-playground.pun7o.click
Available Pages
Main Playground Page (/index.html)
Interactive cookie testing interface with:
- Cookie setting forms with all attributes
- Cookie reading and display
- HTTP request/response inspector
- Pixel tag examples
Parent-Subdomain Test Page (/parent-subdomain-test.html)
Dedicated testing for parent-subdomain cookie relationships:
- Set cookies with parent domain
- Set cookies with subdomain
- Test cookie accessibility
- Cross-subdomain navigation
Cross-Domain Test Page (/cross-domain.html) - Subdomains Only
Testing cross-domain cookie scenarios:
- Third-party pixel loading
- Cross-domain cookie access
- Cookie syncing
Using the Cookie Forms
Fill in Cookie Details:
- Name: Cookie identifier
- Value: Cookie data
- Domain: Leave empty for current domain, or specify parent/subdomain
- Path: URL path where cookie is valid
- SameSite: Cookie same-site policy
- Secure: HTTPS-only flag
- HttpOnly: JavaScript access restriction
- Max-Age: Cookie lifetime in seconds
Set Cookie: Click "Set Cookie" button
Observe:
- HTTP inspector shows Set-Cookie header
- Cookie display updates
- Status code and headers visible
HTTP Inspector
The HTTP inspector shows:
- Status Codes: 200 (success), 404 (not found), etc.
- URLs: Full request and response URLs
- Headers:
- Request: Cookie header (sent cookies)
- Response: Set-Cookie header (received cookies)
- Methods: GET, POST, etc.
Pixel Endpoints
Each domain has a pixel endpoint at /pixel:
- Accepts query parameters
- Logs to CloudWatch
- Returns 1x1 GIF image
Example:
<img src="https://cookie-playground.pun7o.click/pixel?id=123&user=test" />
Testing Workflows
Workflow 1: Basic Cookie Testing
- Visit main playground page
- Set a cookie with default attributes
- Read cookies to verify
- Check HTTP inspector for Set-Cookie header
Sequence Diagram:
sequenceDiagram
participant User
participant Playground as Playground
(cookie-playground.pun7o.click) participant Browser participant Inspector as HTTP Inspector User->>Playground: Visit cookie-playground.pun7o.click Playground->>Browser: HTML page with cookie form Browser->>User: Display cookie playground User->>Playground: Fill form: name=test, value=123
Click Set Cookie Browser->>Browser: "Execute JavaScript
document.cookie = test=123#59; Path=/" Browser->>Inspector: Log: Cookie Set
Set-Cookie: test=123
Path=/ Inspector-->>Browser: Display in HTTP inspector User->>Playground: Click Read All Cookies Browser->>Browser: Read document.cookie Browser->>Inspector: Log: Cookies Read
Cookie: test=123 Browser->>User: Display: test=123 Inspector-->>Browser: Show HTTP details
(cookie-playground.pun7o.click) participant Browser participant Inspector as HTTP Inspector User->>Playground: Visit cookie-playground.pun7o.click Playground->>Browser: HTML page with cookie form Browser->>User: Display cookie playground User->>Playground: Fill form: name=test, value=123
Click Set Cookie Browser->>Browser: "Execute JavaScript
document.cookie = test=123#59; Path=/" Browser->>Inspector: Log: Cookie Set
Set-Cookie: test=123
Path=/ Inspector-->>Browser: Display in HTTP inspector User->>Playground: Click Read All Cookies Browser->>Browser: Read document.cookie Browser->>Inspector: Log: Cookies Read
Cookie: test=123 Browser->>User: Display: test=123 Inspector-->>Browser: Show HTTP details
Workflow 2: Parent-Subdomain Testing
- Visit parent domain test page
- Set cookie with
Domain=cookie-playground.pun7o.click - Navigate to subdomain A
- Verify cookie is accessible
- Set cookie with
Domain=site-a.cookie-playground.pun7o.click - Return to parent domain
- Verify parent cannot access subdomain cookie
Sequence Diagram:
sequenceDiagram
participant User
participant Parent as Parent Domain
(cookie-playground.pun7o.click) participant SubA as Subdomain A
(site-a.cookie-playground.pun7o.click) participant Browser User->>Parent: Visit parent-subdomain-test.html User->>Browser: Click Set Cookie with Domain=cookie-playground.pun7o.click Browser->>Browser: "document.cookie = parent_cookie=value#59; Domain=cookie-playground.pun7o.click" Browser->>Browser: Store cookie User->>SubA: Navigate to site-a.cookie-playground.pun7o.click/parent-subdomain-test.html User->>Browser: Click Read Cookies Browser->>Browser: Check cookies for site-a.cookie-playground.pun7o.click Browser->>Browser: Find parent_cookie (Domain=cookie-playground.pun7o.click matches) Browser->>User: Display: parent_cookie=value Note over Browser: Subdomain can access parent cookie ✓ User->>Browser: Click Set Cookie with Domain=site-a.cookie-playground.pun7o.click Browser->>Browser: "document.cookie = subdomain_cookie=value#59; Domain=site-a.cookie-playground.pun7o.click" User->>Parent: Navigate to cookie-playground.pun7o.click/parent-subdomain-test.html User->>Browser: Click Read Cookies Browser->>Browser: Check cookies for cookie-playground.pun7o.click Browser->>Browser: subdomain_cookie NOT found (Domain mismatch) Browser->>User: Display: parent_cookie=value (subdomain_cookie NOT shown) Note over Browser: Parent cannot access subdomain cookie ✗
(cookie-playground.pun7o.click) participant SubA as Subdomain A
(site-a.cookie-playground.pun7o.click) participant Browser User->>Parent: Visit parent-subdomain-test.html User->>Browser: Click Set Cookie with Domain=cookie-playground.pun7o.click Browser->>Browser: "document.cookie = parent_cookie=value#59; Domain=cookie-playground.pun7o.click" Browser->>Browser: Store cookie User->>SubA: Navigate to site-a.cookie-playground.pun7o.click/parent-subdomain-test.html User->>Browser: Click Read Cookies Browser->>Browser: Check cookies for site-a.cookie-playground.pun7o.click Browser->>Browser: Find parent_cookie (Domain=cookie-playground.pun7o.click matches) Browser->>User: Display: parent_cookie=value Note over Browser: Subdomain can access parent cookie ✓ User->>Browser: Click Set Cookie with Domain=site-a.cookie-playground.pun7o.click Browser->>Browser: "document.cookie = subdomain_cookie=value#59; Domain=site-a.cookie-playground.pun7o.click" User->>Parent: Navigate to cookie-playground.pun7o.click/parent-subdomain-test.html User->>Browser: Click Read Cookies Browser->>Browser: Check cookies for cookie-playground.pun7o.click Browser->>Browser: subdomain_cookie NOT found (Domain mismatch) Browser->>User: Display: parent_cookie=value (subdomain_cookie NOT shown) Note over Browser: Parent cannot access subdomain cookie ✗
Workflow 3: Cross-Domain Pixel Testing
- Visit subdomain A
- Load pixel from parent domain
- Check HTTP inspector for request/response
- Verify CloudWatch logs for pixel activity
Sequence Diagram:
sequenceDiagram
participant User
participant SubA as Subdomain A
(site-a.cookie-playground.pun7o.click) participant Parent as Parent Domain
(cookie-playground.pun7o.click) participant Browser participant CloudWatch as CloudWatch Logs User->>SubA: Visit site-a.cookie-playground.pun7o.click SubA->>Browser: HTML page with pixel tag Browser->>Browser: Set cookie: user_id=test123
(first-party cookie on subdomain A) Browser->>Parent: GET /pixel?id=123&user=test123 HTTP/1.1
Cookie: (parent cookies if any) Parent->>Parent: Lambda: pixel-handler executes
Extract query params: id=123, user=test123
Extract headers: Cookie, User-Agent, Referer Parent->>CloudWatch: PutLogEvents
{timestamp, params, headers, IP} CloudWatch-->>Parent: Log entry created Parent->>Browser: HTTP 200 OK
Content-Type: image/gif
1x1 transparent GIF Browser->>Browser: Render pixel (invisible) User->>CloudWatch: Check logs (AWS Console) CloudWatch-->>User: Display log entry with pixel request details
(site-a.cookie-playground.pun7o.click) participant Parent as Parent Domain
(cookie-playground.pun7o.click) participant Browser participant CloudWatch as CloudWatch Logs User->>SubA: Visit site-a.cookie-playground.pun7o.click SubA->>Browser: HTML page with pixel tag Browser->>Browser: Set cookie: user_id=test123
(first-party cookie on subdomain A) Browser->>Parent: GET /pixel?id=123&user=test123 HTTP/1.1
Cookie: (parent cookies if any) Parent->>Parent: Lambda: pixel-handler executes
Extract query params: id=123, user=test123
Extract headers: Cookie, User-Agent, Referer Parent->>CloudWatch: PutLogEvents
{timestamp, params, headers, IP} CloudWatch-->>Parent: Log entry created Parent->>Browser: HTTP 200 OK
Content-Type: image/gif
1x1 transparent GIF Browser->>Browser: Render pixel (invisible) User->>CloudWatch: Check logs (AWS Console) CloudWatch-->>User: Display log entry with pixel request details
CloudWatch Logs
Pixel endpoint requests are logged to CloudWatch:
- Log Group:
/aws/lambda/cookie-playground-pixel-{server} - Each request includes: timestamp, query params, headers, IP address
View logs in AWS Console or CLI:
aws logs tail /aws/lambda/cookie-playground-pixel-main --follow
Browser Developer Tools
For deeper inspection:
- Open Browser DevTools (F12)
- Go to Network tab
- Filter by domain
- Inspect requests/responses
- View Cookies tab for all stored cookies
Tips
- Clear Browser Cache: When testing, clear cookies between tests
- Use Incognito: Test in private/incognito mode for clean state
- Check Multiple Browsers: Different browsers may behave differently
- Observe HTTP Headers: The inspector helps understand what's actually sent/received
Next Steps
- Follow the Manual Testing Guide for step-by-step procedures
- Learn about HTTP Inspection to understand the details
- Review Browser Behaviors for browser-specific differences