I am trying to get the name, value field as cookies using loop. in my app.get method and then posting the field values in app.post method, I am using expressjs.
Can please anybody check the 'for loop' below and see my commented lines and brighten my knowledge on how to achieve the email field.
Please also check my uploaded image for UI.
var cookies = [];
if (req.cookies) {
for (var cookieName in req.cookies) {
var cookieValue = req.cookies[cookieName];
// var cookieEmail = req.cookies[cookieValue]; //I dont see my email being posted to server
cookies.push({ name: cookieName, value: cookieValue });
// cookies.push({ name: cookieName, value: cookieValue, email: cookieEmail });
}
}