Hi,
2 years ago i wrote a simple api client for proxmox in python3 with aiohttp, pmxc.
In the api2client/connection.py I'm connecting to the Proxmox VE Server and on line 173 you see the cookie and later the CSRF token usage.
I hope this helps you!
Kind regards,
René