Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2006

Tip: Looking for answers? Try searching our database.

Cookies in a Webservice Client

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric - 13 Sep 2006 15:03 GMT
I would like to read cookies in the client (WinForm App), which where sent by
a server.

I have set  "ws.CookieContainer = New System.Net.CookieContainer()"
in my client, before I call the webservice.

Is there more things to do? Do in need to enable session in my proxy?

thanks
Eric
Gaurav Vaish (www.EduJiniOnline.com) - 13 Sep 2006 17:09 GMT
>I would like to read cookies in the client (WinForm App), which where sent
>by
[quoted text clipped - 4 lines]
>
> Is there more things to do? Do in need to enable session in my proxy?

No. That's it.
Just set it once... and use the same container everytime :-)

Signature

Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------

Steven Cheng[MSFT] - 14 Sep 2006 03:06 GMT
Hi Eric,

I think that's enough, after each request, if the server-side resposne has
add new cookie, you'll be able to get them in the container. As for
enableSession, it is not necessary, because enableSession only means that
the server-side will add a sessionID cookie into the response cookie
collection(if it is not using cookieless session).  

BTW, if possible, we always not recommend use session, cookie or other
stateful storage since that's not conform to the webservice standards.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
Eric - 14 Sep 2006 08:51 GMT
Thanks Steven,

It's a special case. It's SSO (Single Sign On) service, which returns a
token and for older browser application, a cookie.
I would like to keep this cookie.

Eric
Steven Cheng[MSFT] - 15 Sep 2006 03:12 GMT
Thanks for the followup Eric,

If you meet any further problem or have any other questions, please feel
free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
John Saunders - 13 Sep 2006 20:10 GMT
>I would like to read cookies in the client (WinForm App), which where sent
>by
[quoted text clipped - 4 lines]
>
> Is there more things to do? Do in need to enable session in my proxy?

Web Services don't usually do cookies. In fact, I don't even know if it's
possible.

John
Gaurav Vaish (www.EduJiniOnline.com) - 14 Sep 2006 03:54 GMT
> Web Services don't usually do cookies. In fact, I don't even know if it's
> possible.

It is possible.
If one looks at the 'Session'-framework for ASP.Net based web-services, it
is all through cookies.

But yes, since WS is not limited to only HTTP-transport, cookies should not
be used unless necessary.

Signature

Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.