How to extract token from Authorization header response using Fetch API?

I have a react app that makes a post request using the Fetch API and receives a Response that has a token in the Authorization header. I want to store that on the client-side in the cookies. And when I make a different request I will get that token from the cookies and send it through the header. How do I go about extracting this token from the header and storing it in cookies?