How do i get cookies from my API response and save as a global variable?

how can i get the cookie from my API response and save as a global variable.

@wale_Goold Do you have the answer?