How to programmatically set KEYCLOAK_ADAPTER_STATE cookie

I’ve successfully logged into Keycload programmatically via the AuthzClient and obtained an RPT, I now wish to set this login into the client by pushing the KEYCLOAK_ADAPTER_STATE cookie: how can I convert the RPT to the cookie value?