[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / network/SessionPhase

# network/SessionPhase

## Type Aliases

### SessionPhase

> **SessionPhase** = `"handshake"` \| `"login"` \| `"encryption"` \| `"resourcePacks"` \| `"play"`

Defined in: [packages/prismarine/src/network/SessionPhase.ts:17](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/network/SessionPhase.ts#L17)

Where a connection stands in the join exchange. Every connection starts in `handshake`;
the handlers that complete each step advance it:

- `handshake` → `login`: `RequestNetworkSettingsHandler`, once a codec is negotiated.
- `login` → `encryption`: `LoginHandler`, after it sent `ServerToClientHandshake` and
  turned encryption on. A login with no identity key skips this phase.
- `encryption` → `resourcePacks`: `ClientToServerHandshakeHandler`, which finishes the
  login once the client proves it holds the key by sending an encrypted reply.
- `login` → `resourcePacks`: `LoginHandler`, once the login became a player session.
- `resourcePacks` → `play`: `ResourcePackClientResponseHandler`, when the client reports
  the resource pack exchange `Completed` and the join burst starts.

Each packet handler declares the phases it accepts; the dispatcher drops a packet that
arrives outside them.
