node.js 获取cookie

   var Cookies ={};
if (req.headers.cookie != null) {
req.headers.cookie.split(';').forEach(l => {
var parts = l.split('=');
Cookies[parts[0].trim()] = (parts[1] || '').trim();
});
}

  

05-02 04:25