Quote:
Originally Posted by Buckyx
Can someone give an idea why webclient changes sessionid sometimes after async request?
I run first http request from UI thread, other requests are sent from handler methods to those response from separate thread
it wouldnt be a problem but theres an AjaxToken I need to use that is linked to sessionid and I somehow cant recieve the correct token at the time needed
edit: another stupid question got answer by myself. solved when I used webbrowser initially login, then transfered cookies to webclient then it always kept sessionid and ajaxtoken
|
You need to assign a cookie container to your WebClient, otherwise it won't store cookies correctly.
Simple example that should fix it for you:

Not the best code, but it should do the trick for you.