WebClient changing sessionid

06/23/2016 15:05 Buckyx#1
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
07/07/2016 14:02 UniveX'#2
Quote:
Originally Posted by Buckyx View Post
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: [Only registered and activated users can see links. Click Here To Register...]
Not the best code, but it should do the trick for you.