Read a token cookie from a request. Accepts a Headers object,
anything with a .headers (e.g. Request), or the raw Cookie
header string. Returns undefined when absent or malformed.
Throws TypeError on a shape it does not accept - notably a
Node/Express request, whose headers is a plain record. "I was
handed something I don't understand" must not be indistinguishable
from "this request carried no token".
Read a token cookie from a request. Accepts a
Headersobject, anything with a.headers(e.g.Request), or the rawCookieheader string. Returnsundefinedwhen absent or malformed.Throws TypeError on a shape it does not accept - notably a Node/Express request, whose
headersis a plain record. "I was handed something I don't understand" must not be indistinguishable from "this request carried no token".