How to Edit Cookies
Opening the Edit Dialog
- In Cookie Lens, find the cookie you want to edit.
- Click on the cookie row to open its details.
- Click the Edit button.
- The edit dialog opens with all fields editable.
Editing Cookie Value
Quick Edit
- Click the cookie row.
- The Value field shows the current value.
- Modify the value directly.
- Click Save to apply immediately.
- The page may need to reload to see effects.
Important Notes
- If the cookie value is structured (JSON, JWT, Base64, etc.), you can edit it in decoded form — Cookie Lens automatically re-encodes when saving.
- See Parsing Values for more details.
- The original value is saved for your session (you can revert if needed).
Editing Cookie Attributes
Domain
Change which domain(s) can access the cookie:
.example.com— accessible fromexample.comand all subdomains (www,api, etc.).example.com— accessible only from the exact domain.- Keep the leading dot (
.) for cross-subdomain cookies.
Chrome may reject the change if the new domain doesn't match the current site.
Path
Restrict the cookie to a specific URL path:
/— entire site (most common)./admin— only/admin/*URLs./api/v2— only/api/v2/*URLs.
Expiration
Set when the cookie expires:
- Session — expires when the browser window closes.
- Date/time — pick a specific expiry time.
- Custom seconds — set as Unix timestamp or days from now.
- Never expires — very far in the future (not recommended for auth cookies).
Secure Flag
Requires HTTPS:
- Enabled — only sent over HTTPS (recommended).
- Disabled — sent over both HTTP and HTTPS (avoid for sensitive data).
Chrome's webRequest API may enforce Secure cookies on modern sites.
HttpOnly Flag
Prevents JavaScript access:
- Enabled — JavaScript cannot read (best for security).
- Disabled — JavaScript can read and modify (use only if needed).
For auth tokens, always enable HttpOnly to prevent XSS attacks.
SameSite Policy
Control cross-site request behavior:
- Strict — only sent in same-site requests (most secure).
- Lax — sent on top-level navigation, not cross-site (default).
- None — sent in all requests (requires Secure flag, for CDNs).
- Unspecified — browser default (usually Lax).
Confirming Changes
Production Site Warning
If you're editing on a production domain (not localhost, staging, etc.):
- A warning appears before save.
- Review your changes carefully.
- Confirm that you want to modify production cookies.
Save vs. Discard
- Save — apply changes to the actual cookie.
- Discard — close without saving (cookie unchanged).
The page may reload after save to reflect changes.
Mocking Cookies (Test Without Saving)
Want to test with different values without permanently changing the cookie?
- Click the cookie row.
- Click Mock This Cookie.
- Enter the mock value you want to test.
- The cookie is immediately replaced with the mock value.
- The original value is saved for the session.
- Click Restore Original to switch back.
- Mocks reset when the page reloads (unless you re-apply).
This is great for:
- Testing different authentication states without logging in/out.
- Simulating feature flags (A/B tests, feature gates).
- Testing error scenarios (expired tokens, invalid values).
- Validating parsing logic with different data formats.
Bulk Editing
Delete Multiple Cookies
- Select cookies by checking their checkboxes.
- Click Delete Selected.
- Confirm the deletion.
- On production domains, provide additional confirmation.
Copy & Paste Values
- Copy the full value from one cookie.
- Paste into another cookie's value field.
- Edit attributes as needed.
- Save.
Safety Features
Protected Cookies
Some cookies are marked as Protected:
- Deleting requires confirmation.
- Useful for important auth tokens.
- Click the lock icon to toggle protection.
Confirmation Dialogs
Critical operations ask for confirmation:
- Deleting any cookie.
- Deleting multiple cookies.
- Editing on production domains.
- Removing protection.
Undo / Revert
If you make a mistake:
- Before reload: click Restore Original in the cookie details.
- After reload: use the Events tab to see change history and repeat the edit.
- Full recovery: re-import the cookie from a saved JSON export.
Common Use Cases
Test Authentication
- Find your
sessionIdoraccessTokencookie. - Mock it with an invalid or expired value.
- Observe application behavior.
- Click Restore Original to get back to normal.
Simulate Localization
- Find the language preference cookie (e.g.
lang=en). - Edit to
lang=esor another language. - Reload the page to see localization.
- Restore when done.
Experiment with Consent
- Find cookie consent flags (e.g.
cookieConsent=all). - Change to
cookieConsent=none. - Test analytics and tracking disable.
- Restore to verify re-enable.
Debug Expiry Issues
- Find the problematic cookie.
- Change expiration to "expires in 10 seconds".
- Watch the cookie disappear.
- Edit again to extend the expiration.
Tips & Tricks
- Preview mode — edit in the dialog before saving to catch mistakes.
- Copy from DevTools — right-click → Copy full cookie details from the Application tab.
- Batch operations — select multiple cookies to delete them all at once.
- Date picker — click the expiration field to get a calendar picker.
- Keyboard shortcuts —
Ctrl/Cmd+Sto save,Escto cancel.
See Also
- Parsing Values — decode and edit structured values.
- Mocking Cookies — in-depth guide to testing with mocks.
- Inspecting Cookies — understanding cookie attributes.