# http: invalid cookie

- **ID:** `go/http-cookie-invalid`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Attempting to parse or set a cookie with invalid syntax, such as missing name or invalid characters.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Use http.SetCookie with a valid Cookie struct and validate fields
   ```
2. **** (90% success)
   ```
   When parsing, use http.Request.Cookie and handle error gracefully
   ```

## Dead Ends

- **** — May lead to session issues or lost data (60% fail)
- **** — Prone to errors and may not cover all cases (70% fail)
