viewpoint-particle

Author Topic: Retrieving Cookies ...  (Read 5641 times)

mhall

  • Jr. Member
  • **
  • Posts: 86
Retrieving Cookies ...
« 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


mhall

  • Jr. Member
  • **
  • Posts: 86
Re: Retrieving Cookies ...
« Reply #1 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?

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Retrieving Cookies ...
« Reply #2 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
Deana F.
Technical Support
Wilson WindowWare Inc.

mhall

  • Jr. Member
  • **
  • Posts: 86
Re: Retrieving Cookies ...
« Reply #3 on: September 20, 2013, 06:24:46 pm »
Thanks Deana, I appreciate it.