Nmap Development mailing list archives
Re: How do I coerce cookie from response.cookies to string I know the
From: nnposter <nnposter () users sourceforge net>
Date: Wed, 20 Sep 2017 10:06:34 -0600
The issue is that you are trying to iterate over "kies.value", where "kies" is the cookie table (cookie list): strcookies = "" for k, v in pairs(kies.value) do kies = kies .. k ..": " .. value .. "" end Secondly, you are iterating over a list so you should be using ipairs(), not pairs(). Thirdly, you are destroying the cookie table in the process by assigning to "kies". You probably meant to assign to "strcookies" instead. You should do the iteration as follows: strcookies = {} for _, cookie in ipairs(kies) do table.insert(strcookies, cookie.name .. ": " .. cookie.value) end strcookies = table.concat(strcookies, "<some separator string>") Cheers, nnposter _______________________________________________ Sent through the dev mailing list https://nmap.org/mailman/listinfo/dev Archived at http://seclists.org/nmap-dev/
Current thread:
- How do I coerce cookie from response.cookies to string I know the response.cookies is a table having another table as value but I just kept getting error bad argument #1 to pairs (table expected, got nil) when iterating through the table I need to be able to send cookie as a string I tried manipulating my code I don't seem to get it to work Alo Yommist (Sep 20)
- Re: How do I coerce cookie from response.cookies to string I know the nnposter (Sep 20)