Thursday, March 31, 2011

How to keep logged instance (httpwebrequest) alive and query another page with it?

Hi,

After I've succesfully logged into website using POST variables by httpwebrequest and got response by HttpWebResponse ..How do I query other websites with the "current logged in" instance? Do I save it to some variable??

From stackoverflow
  • POST variables are accessed server side, and user state would typically be stored with a cookie or in a session.

    The HttpWebResponse class offers a Cookies collection that you can use to save the encrypted authentication data or session key for use in future HttpWebRequest under HttpWebRequest.CookieContainer.

    Of course, this is all under the assumption that the initial request stores the user authentication data in one of these forms.

0 comments:

Post a Comment