I have an HttpHandler that requests 3 web services in a single request and stores the results in a single cookie.
Do you think the results are colliding. Here's how:
The process is as follows: when I request service 1 and expect the result, the cookie storing the results does not exist yet, then the result comes from service 2 and volia, creates a cookie, saves the result, and then the response comes back from service 1 and overwrites this cookie that shouldn't be.
what I like is the queue for these requests.
Should I do this client side through javascript? if so, how? :)
or do it server side?
therefore I do not want asynchronous calls. is not it?
here is the code:
if(service1.isEnabled){ invokeService1(); } if(service2.isEnabled){ invokeService2(); } if(service3.isEnabled){ invokeService3(); } invokeService1(){ callToService1();
when responses arrive at the HttpHandler, it comes with a request.
then on this HttpHandler:
HttpCookie cookie = request.Cookie.Get(MYCookie) ?? new HttpCookie(MYCookie); if(request.Params["foo"]){ //set cookie content } if(request.Params["Bar"].isNotNullOrEmpty()){ //set cookie content }
this is how i installed it. I think the way to create a cookie is the problem.
source share