How to set cookie after login successful

I’m trying to add an iframe containing grafana in my web application trying to skip the page by authenticating from the web application code.
The http post call for authentication is successful but I cannot access grafana because the cookie is not set.
As a result, I am redirected back to the login page despite in the response header of the http call in “Network” tab of Chrome I see this:


This is the cookie that is set

Is there a way to solve this problem?