I have subdomain front.test.local as frontend ngx-app and another subdomain back.test.local for the backend pure Drupal both on https - cookie-domain is set to '.test.local'. I need cookie because views resource with image thumbnails in private://. I trying to get a cookie on frontend after login response in a second request to custom post resource /custom/cookie again basic_auth. I adding a headers array
$headers = ['Set-cookie'=>'sess_name=sess_id', 'test: name=value;'];
to return from post resource
new ModifiedResourceResponse($data, 200, $headers);
The response headers seem the same every time: ["content-language", "cache-control", "content-type", "expires"] - no 'test', no cookies
Is it possible to set additional response headers, 'Set-cookie' or another? For now, I sending a sessName and sessID in this second response and frontend create a cookie - and this works fine, but it will be nice to set this cookie through a set-cookie header though.
edit2: improved workaround to skip doubled post with basic_auth (which produce 2 sessions) to one - gist to CustomLoginResource https://gist.github.com/svetlio/156ed32ecccbd38cfae32357a5d6093d return sessId&sessName alongside user id name roles but missing csrf_token , still missing Set-cookie header