# RuntimeError: Session is closed

- **ID:** `python/aiohttp-session-client-closed`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

An aiohttp.ClientSession was closed (via async with or session.close()) but a coroutine still attempted to use it to make a request.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8+ | active | — | — |
| 3.9+ | active | — | — |
| 3.10+ | active | — | — |
| 3.11+ | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   session = aiohttp.ClientSession()
try:
    await fetch_all(session)
finally:
    await session.close()
   ```
2. **** (93% success)
   ```
   async with aiohttp.ClientSession() as session:
    async with session.get(url) as resp:
        data = await resp.text()
   ```

## Dead Ends

- **** — Reassigning does not resurrect the closed object; any references held elsewhere still point to the closed session. (70% fail)
- **** — The connector is also closed with the session; manual connect raises the same error. (85% fail)
