Automatic Cookie Management
LiteClient automatically handles cookies without manual configuration:Server Sets Cookies
When a server sends a
Set-Cookie header in the response, LiteClient automatically stores it in the cookie jar.Cookies Sent Automatically
On subsequent requests to the same domain, LiteClient automatically includes relevant cookies in the request headers.
Domain and Path Matching
Cookies are sent only to matching domains and paths based on the cookie’s domain and path attributes.
Cookie management is fully automatic. You don’t need to manually copy cookies or configure cookie headers.
Viewing Cookies
View cookies in two places:Cookie Persistence
Cookies are automatically saved and loaded across VS Code sessions:- Automatic Save - Cookies are saved to disk immediately when received
- Session Persistence - Cookies persist when you close and reopen VS Code
- Storage Location - Cookies are stored in
cookies.jsonin your storage directory - Per-Scope Storage - Global and workspace storage maintain separate cookie jars
Session cookies (cookies without an expiration date) are persisted across VS Code sessions, unlike browser behavior where session cookies are cleared when the browser closes.
Cookie Attributes
LiteClient respects standard cookie attributes:Domain Attribute
Controls which domains receive the cookie:- Exact domain -
domain=api.example.commatches onlyapi.example.com - Subdomain wildcard -
domain=.example.commatchesapi.example.com,www.example.com, etc. - No domain - Cookie is sent only to the exact origin that set it
Path Attribute
Controls which URL paths receive the cookie:path=/- Cookie sent to all pathspath=/api- Cookie sent only to/apiand its subpaths like/api/userspath=/api/v1- Cookie sent only to/api/v1and deeper paths
Secure Flag
WhenSecure is set:
- Cookie is sent only over HTTPS connections
- HTTP requests do not receive the cookie
- Prevents cookie interception over insecure connections
HttpOnly Flag
WhenHttpOnly is set:
- Cookie cannot be accessed by JavaScript
- Protects against XSS attacks
- Automatically respected by LiteClient (no JavaScript access in scripts)
Expires / Max-Age
Controls cookie lifetime:- Expires - Absolute expiration date (
Expires=Wed, 21 Oct 2026 07:28:00 GMT) - Max-Age - Relative expiration in seconds (
Max-Age=3600for 1 hour) - No expiration - Session cookie (deleted when browser closes, but persisted by LiteClient)
LiteClient uses the
tough-cookie library for RFC 6265-compliant cookie handling.Managing Cookies
Delete Individual Cookies
Remove specific cookies from the jar:Delete Domain Cookies
Remove all cookies for a specific domain:Clear All Cookies
Remove all cookies from the jar:- Via Command Palette
Run LiteClient: Clear Cookie Jar from the Command Palette to delete all cookies immediately.
Cookie-Based Authentication
Many APIs use cookies for session management:Login Flow Example
Subsequent Requests
All future requests to the same domain automatically include the session cookie:
You don’t need to manually copy or set cookies. LiteClient handles the entire cookie lifecycle automatically.
Cookie Storage Scope
Cookies are stored according to your active storage scope:- Global Storage
- Workspace Storage
When using global storage (default):
- Cookies are stored in VS Code’s global storage
- Available across all workspaces
- Private to your machine
- Not shared via Git
Debugging Cookie Issues
Cookie Not Being Sent
If a cookie isn’t being sent with requests:- Check domain matching - Verify the request URL matches the cookie’s domain
- Check path matching - Ensure the request path matches the cookie’s path
- Check expiration - Verify the cookie hasn’t expired
- Check Secure flag - Use HTTPS if the cookie has the Secure flag
- Review cookie jar - Open the Cookie Manager to verify the cookie is stored
Cookie Not Being Stored
If a cookie isn’t appearing in the jar:- Check response headers - Verify the server sent a
Set-Cookieheader - Check cookie format - Ensure the
Set-Cookieheader is valid - Check domain attribute - Verify the domain matches the request origin
- Review response - Look for cookie-related errors in the response
Best Practices
Use HTTPS for sensitive cookies
Use HTTPS for sensitive cookies
Clear cookies when switching contexts
Clear cookies when switching contexts
Review cookies periodically
Review cookies periodically
Use separate storage scopes
Use separate storage scopes
Use global storage for personal testing and workspace storage for team-shared test sessions (with caution).
Monitor cookie expiration
Monitor cookie expiration