WinBatch® Technical Support Forum

All Things WinBatch => WebBatch => Topic started by: mhall on September 11, 2013, 06:21:31 PM

Title: Retrieving Cookies ...
Post by: mhall on September 11, 2013, 06:21:31 PM
Hiya,

Just a quick question ... I'm interested in using WebBatch to retrieve the values of certain browser cookies sent to the server. According to the TechDatabase, you would use WebDatData( "cookieName" ) to retrieve the value of a specific cookie. But that returns an error because the function signature of WebDatData is WebDatData( section, keyname, defaultValue ). So I am using WebDatData( 'SYSTEM', 'HTTP_COOKIE', '' ) and this retrieves all of the cookies, which I then have to loop through and inspect to find the ones I'm interested in.

I'm OK with that, but thought I would check to see if there was a more direct method.

And it wouldn't hurt to update the docs. :)

Regards,
Micheal

Title: Re: Retrieving Cookies ...
Post by: mhall on September 19, 2013, 06:12:48 PM
So ... just checking ... Deana (or Tony) is that the only way to go about retrieving cookie values? Retrieving all of them and then inspecting them to find the one you are looking for?
Title: Re: Retrieving Cookies ...
Post by: Deana on September 20, 2013, 08:32:30 AM
Micheal,

I apologize, I seemed to have missed your original post. As I understand it, yes you will need to parse the various cookies. However they should be in a specific format which should make it easy to parse: http://www.w3.org/Protocols/rfc2109/rfc2109
Title: Re: Retrieving Cookies ...
Post by: mhall on September 20, 2013, 06:24:46 PM
Thanks Deana, I appreciate it.