Search code examples
javascriptnetwork-programmingcookieswindows-desktop-gadgets

Javascript Login and Get Information with Post, No Cookies?


so right now I'm writing a Windows 7 Gadget using Javascript (w/HTML) that will grab some information from a page that it needs to log in to. So I have apparently gotten the Post statement to work over the https domain, because now I get a page in the responseText telling me I need to have cookies enabled. Right now I use a ServerXMLHTTP object to make a request, which is comparable to using an XMLHttpRequest object. I don't know that cookies CAN be enabled in a Windows 7 Gadget, so I'm looking for an answer on whether or not they can be, some kind of work around if possible, or some other avenue to take for getting the solution.


Solution

  • I figured I'd come tie up this loose end, I figured out to post to the server by setting a randomly generated cookie of valid length and setting that as the requestheader for the SXH request. Also necessary was to set the address of the server as the host of the SXH request. At that point it was a matter of posting to the correct url and then sending a valid query.