Set-Cookie response header. You can also manually add cookies.
The suggestion above is about including the cookies yourself when testing the site with Netlify Dev. Netlify isn’t adding the cookies; you are doing so manually for testing.
I am not clear about why want to use Netlify to set this header for you. Would you be willing to please explain more about what goal you are trying to accomplish? Because I don’t currently understand the goal, I am unable to confidently give an answer.
You also wrote:
The documentation is a bit unclear on this aspect where it says it’s possible but it doesn’t provide an example?
What documentation are you referring to?