How to create a cookie after handling event in app extension?

I try to create an app (app extension not plugin extension) within Shopware 6. My goal is to handle customer (frontstore) registration/login action via webhook and based on response set cookie to Shopware storefront.
Following the documentation my app needs to share an endpoint and register it in manifest.xml file - which I am already done.

Next my app handle the event and response with some data which I need to save in cookie in storefront of the shop.
How I can handle this?