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: