Historically, in a browser, programmatic access to cookies has revolved around the document.cookie API, which is simply a string getter/setter. To read a single cookie from that string, you must parse the whole string into a structured format.
Full article