How can get php session values or how can i set cookies from c# app itself?
currently i can successfully get/post data but i need cookie support in weclient?
my code
App.webClient.UploadStringAsync(uri, "POST", datax);
How can get php session values or how can i set cookies from c# app itself?
currently i can successfully get/post data but i need cookie support in weclient?
my code
App.webClient.UploadStringAsync(uri, "POST", datax);
I do not see the the exact use case you are working on, but as you are working with cookies, I recommend you start using HttpWebRequest over WebClient
. This class provides you with a CookieContainer.
The Cookies
Property of HttpWebRequest
would help you to send a Cookie from your client to the server, where the HttpWebResponse.Cookies Property get you the possibility to read the cookie, sent by the server.
See Using CookieContainer with WebClient class on how to override your WebClient to gain the ability of using the CookieContainer provided by the HttpWebRequest.
A brief WebClient vs HttpWebRequest can be found on CodeProject