Retrieving Cookies ...

Started by mhall, September 11, 2013, 06:21:31 PM

Previous topic - Next topic

mhall

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


mhall

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?

Deana

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
Deana F.
Technical Support
Wilson WindowWare Inc.

mhall