Right, so if jsessionid value can be received using the way, provided in question, the solution will be to use HttpWebRequest as ExtendedWebClient somehow ignores the jsession value.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "GET";
request.CookieContainer = new CookieContainer();
request.CookieContainer.Add(new Uri(url, UriKind.Absolute), StoredCookieCollection._CookieCollection);
request.BeginGetResponse(new AsyncCallback(GetSomething), request);
private void GetSomething(IAsyncResult asynchronousResult)
{
// do something
}
// where in url a jsession value is added to the request as &jsessionid=value
The other thing, that also doesn't work in Windows Phone is, that you can't serialize CookieCollection type value so easily. So, I decided to store a String type JSESSIONID value in IsolatedStorage settings instead of it, and create a static class StoredCookieCollection, that will store CookieCollection during the app work.
So, when you receive a jsessionid value, it is saved in settings as string, and saved in static class as CookieCollection :
using (HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult))
{
CookieCollection cookies = response.Cookies;
StoredCookieCollection._CookieCollection = cookies;
...
}
That approach will really force the app to work in single session.
Perhaps, there is a more elegant solution with CookieCollection serialization, but I couldn't find it out.