encodeSessionPayload

Encodes session JSON for transport as base64 of its gzipped bytes.

The DevTools protocol carries session payloads as JSON string fields, so compressed bytes have to survive a JSON round trip. Base64 costs a third on top of the compressed size, which against a typical gzip ratio still leaves the payload far smaller than the raw JSON it replaces.