views:

489

answers:

2

I have a window application, it calls a web service to get information. One of the functionalities of the window application is to go to a web page. In this web page, it’s looking for cookies on the client machine, and logs them in if the cookies is valid.

What I was trying to do is to create the same cookie on a web service call. However this cookie disappears after the service call is finished, so the next time I call the web service again, it’s gone.. (for test purpose) and it’s not in the client machine anymore.

Thanks in Advance.

+1  A: 

On the client you shoud store cookie value manually and then reuse it with the next service call.

// C#, you have to create a Cookie Container
myService.CookieContainer = new System.Net.CookieContainer();
Koistya Navin
Could you please post the code you are using to accomplish this?
Angela
Depends on which programming language are you using..
Koistya Navin
A: 

I don't think it's possible, especially if you can't be sure what web browser is going to launch.

You'd probably be better off sending them a one-time-only token with the URL from the web service that will let them in on the web site. Then the site can set the cookie as if they logged in.

if any of that is feasible in your model. I don't know if you have access to the site you are sending them a URL of.

Moose