0

I'm developing a Windows Desktop Gadget. From within the gadget, I have to login to an external website, get a response from a specific page and display required information from it.

I have implemented the request using jQuery's $.post(). First, I send the post parameters to the application and it receives a 302 response. After that, when I send subsequent jQuery $.get() requests to other pages, it is not posting the required cookies.

How can I resolve this?

Andy E
  • 338,112
  • 86
  • 474
  • 445
Sundararajan S
  • 1,358
  • 2
  • 14
  • 24

2 Answers2

1

Windows Desktop Gadgets don't automatically store cookies from XMLHttpRequests. You should be able to use getResponseHeader("Set-Cookie") and then set them for future requests by specifying them in the headers config for $.ajax.

For more information, see the HTTP cookie (Wikipedia) and jQuery.ajax().

Andy E
  • 338,112
  • 86
  • 474
  • 445
1

Check this tute on using cookies with windows gadgets..

http://blogs.msdn.com/b/jaimer/archive/2006/09/28/making-rest-calls-and-using-session-state-from-a-sidebar-gadget_2e00_2e00_2e00_.aspx

Neeraj
  • 8,408
  • 8
  • 41
  • 69