Depends on T399198: Define standard JWT session data for supported session types and T399243: Support JWT generation for session tokens in MediaWiki core and on the pending decision in T394012#10980179. Removing existing cookies is out of scope for now, we'll duplicate some information. Consistency between cookies will be enforced though.
We'll put it behind a configuration flag as it's not relevant to most MediaWiki installations and adds extra bytes to every request.