HTTP Inspection Guide
How to read and understand HTTP requests and responses in the cookie playground, including status codes, URLs, and headers.
Understanding HTTP Inspection
The playground includes an HTTP inspector that displays real-time HTTP traffic, showing requests and responses with full details.
Status Codes
Common Status Codes in Playground
200 OK
- Successful request
- Cookie set successfully
- Page loaded correctly
301 Moved Permanently
- Redirect response
- Location header contains redirect target
- Browser follows redirect automatically
302 Found
- Temporary redirect
- Similar to 301 but temporary
404 Not Found
- Resource doesn't exist
- Invalid path requested
400 Bad Request
- Invalid request format
- Missing required parameters
Status Code Interpretation
In HTTP Inspector:
- Green (status-200): Success
- Red (status-404): Not found
- Yellow (status-other): Other status
What to Look For:
- Status code tells you if request succeeded
- 200 = success, 4xx = client error, 5xx = server error
URLs in HTTP Inspector
Request URLs
Format: Full URL including protocol, domain, path, and query parameters
Example:
URL: https://cookie-playground.pun7o.click/index.html
URL: https://cookie-playground.pun7o.click/pixel?id=123&user=test
What to Check:
- Protocol: Should be
https:// - Domain: Correct domain for the test
- Path: Matches the resource requested
- Query Parameters: Present if used
Response URLs
For Redirects:
Location: https://site-a.cookie-playground.pun7o.click/index.html
Interpretation:
- Shows where redirect points
- Browser automatically follows Location header
- Cookie behavior during redirect depends on SameSite
Request Headers
Cookie Header
Format:
Cookie: name1=value1; name2=value2; name3=value3
What It Shows:
- All cookies sent with the request
- Matched based on Domain and Path
- URL-encoded if needed
Example:
Cookie: session=abc123; preference=dark; cart=item1,item2
What to Look For:
- Which cookies are included
- Cookie values
- Cookie count
User-Agent Header
Format:
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
Purpose:
- Identifies browser and OS
- Useful for debugging browser-specific issues
Referer Header
Format:
Referer: https://example.com/previous-page
What It Shows:
- Page that linked to current request
- Useful for tracking navigation flow
- May be absent for direct navigation
Other Request Headers
Accept:
Accept: text/html,application/xhtml+xml
- What content types browser accepts
Accept-Language:
Accept-Language: en-US,en;q=0.9
- Browser language preferences
Response Headers
Set-Cookie Header
Format:
Set-Cookie: name=value; Domain=example.com; Path=/; Secure; HttpOnly; SameSite=Strict; Max-Age=3600
What to Inspect:
- Cookie Name and Value: Basic data
- Domain: Which domains can access
- Path: Which paths cookie applies to
- Secure: HTTPS-only flag
- HttpOnly: JavaScript access restriction
- SameSite: Cross-site policy
- Max-Age/Expires: Expiration time
Example Analysis:
Set-Cookie: session=abc123; Domain=cookie-playground.pun7o.click; Path=/; Secure; HttpOnly; SameSite=Strict; Max-Age=86400
Breakdown:
- Name:
session - Value:
abc123 - Domain:
cookie-playground.pun7o.click(accessible by this domain and subdomains) - Path:
/(all paths) - Secure: Only over HTTPS
- HttpOnly: Not accessible via JavaScript
- SameSite=Strict: Only same-site requests
- Max-Age=86400: Expires in 1 day
Location Header (Redirects)
Format:
Location: https://target-domain.com/path
What It Shows:
- Redirect target URL
- Browser follows this URL
- Cookie behavior during redirect depends on SameSite
Content-Type Header
Format:
Content-Type: text/html; charset=utf-8
Content-Type: image/gif
Purpose:
- Tells browser how to handle response
- HTML pages:
text/html - Pixel images:
image/gif
Cache-Control Header
Format:
Cache-Control: no-cache, no-store, must-revalidate
Purpose:
- Controls browser caching
- Playground uses no-cache for testing
- Ensures fresh content
Using the HTTP Inspector
In Playground
Location: HTTP Request/Response Inspector panel on playground pages
What It Shows:
- Real-time HTTP traffic
- Requests (with method, URL, headers)
- Responses (with status, headers)
- Chronological order (newest first)
Features:
- Clear button to reset display
- Color-coded status codes
- Formatted header display
- Scrollable history
In Browser DevTools
Network Tab:
- Open DevTools (F12)
- Go to Network tab
- Enable "Preserve log"
- Filter by domain if needed
- Click on any request
- View Headers tab
What You See:
- Request Headers (sent by browser)
- Response Headers (sent by server)
- Request/Response payloads
- Timing information
Reading HTTP Inspector Output
Example Output
═══════════════════════════════════════════════════════════
[14:30:15] Cookie Set
───────────────────────────────────────────────────────────
Set-Cookie: test=value123; Domain=cookie-playground.pun7o.click; Path=/; SameSite=Lax
───────────────────────────────────────────────────────────
[14:30:20] FETCH Request
───────────────────────────────────────────────────────────
URL: https://cookie-playground.pun7o.click/pixel?id=123
Method: GET
Headers: {
"Cookie": "test=value123",
"User-Agent": "Mozilla/5.0..."
}
───────────────────────────────────────────────────────────
[14:30:20] RESPONSE
Status: 200 OK
Header: Content-Type: image/gif
───────────────────────────────────────────────────────────
How to Read
- Timestamp: When request/response occurred
- Type: REQUEST, RESPONSE, Cookie Set, etc.
- Details: URL, method, status, headers
- Separators:
───separates entries
Inspecting Specific Scenarios
Scenario 1: Cookie Setting
What to Look For:
[timestamp] Cookie Set
Set-Cookie: name=value; Domain=...; Path=...; ...
Verify:
- All attributes present
- Values correct
- Format valid
Scenario 2: Cookie Reading
What to Look For:
[timestamp] Cookies Read
Cookie: name1=value1; name2=value2
Verify:
- Expected cookies present
- Values correct
- Cookie count matches
Scenario 3: Pixel Request
What to Look For:
URL: https://domain/pixel?id=123&event=click
Method: GET
Headers: {
"Cookie": "...",
"Referer": "..."
}
Verify:
- Query parameters present
- Cookies sent (if applicable)
- Referer header (if from another page)
Scenario 4: Redirect Flow
What to Look For:
[14:30:15] REQUEST
URL: https://redirect.domain.com/
Method: GET
[14:30:15] RESPONSE
Status: 301 Moved Permanently
Header: Location: https://target.domain.com/
[14:30:15] REQUEST (redirect follow)
URL: https://target.domain.com/
Method: GET
Cookie: ... (if sent)
Verify:
- 301 status code
- Location header correct
- Cookies sent with redirect (if SameSite allows)
Common Patterns to Recognize
Pattern 1: Successful Cookie Set
Set-Cookie: name=value; Domain=...; Path=...; ...
Status: 200 OK
Indicates: Cookie set successfully
Pattern 2: Cookie Sent with Request
Cookie: name1=value1; name2=value2
Indicates: Browser included cookies in request
Pattern 3: Cookie Not Sent
Missing Cookie header or Cookie: (empty)
Possible Causes:
- Domain mismatch
- Path mismatch
- Cookie expired
- SameSite blocking
- Browser privacy settings
Pattern 4: Redirect with Cookie
Status: 301 Moved Permanently
Location: https://target.com/
Cookie: session=abc (in follow-up request)
Indicates: Cookie sent with redirect (SameSite=Lax or None)
Troubleshooting with HTTP Inspector
Cookie Not Being Set
Check:
- Set-Cookie header present in response?
- All attributes correct?
- Status code 200?
- Any errors in console?
Cookie Not Being Sent
Check:
- Cookie header in request?
- Domain matches request domain?
- Path matches request path?
- Cookie expired?
- SameSite blocking?
Unexpected Behavior
Check:
- All headers present?
- Status codes correct?
- URLs match expectations?
- Compare multiple requests
Advanced Inspection
Comparing Requests
- Set cookie with specific attributes
- Make request
- Check Cookie header
- Modify attributes
- Repeat request
- Compare headers
Timing Analysis
- Note timestamp of cookie set
- Note timestamp of request
- Verify cookie present if timing allows
- Check expiration times
Cross-Domain Inspection
- Set cookie on domain A
- Load pixel from domain B
- Inspect pixel request headers
- Verify cookie behavior
Browser DevTools vs Playground Inspector
Browser DevTools Advantages
- More detailed timing
- Request/response payloads
- Network waterfall view
- Resource loading analysis
Playground Inspector Advantages
- Educational focus
- Clear cookie-focused display
- Integrated with testing
- Easy to understand format
Best Practice
- Use both for comprehensive understanding
- Playground inspector for cookie-specific info
- Browser DevTools for detailed network analysis
Related Topics
- HTTP Headers - Detailed header explanations
- Manual Testing Guide - Testing procedures
- Troubleshooting - Debugging with HTTP inspection
Next Steps
- Practice reading HTTP inspector output
- Compare different cookie scenarios
- Use browser DevTools for deeper analysis
- Review Browser Behaviors for browser differences