tags:

views:

54

answers:

3

Hello, How can i get a httponly cookie in a httpwebresponse ? Habitually i use a CookieContainer to get the cookies in a httpwebresponse, but it doesnt work with httponly cookie.

Is there an other way to catch them ?

A: 

You cannot retrieve HTTPOnly cookies from the CookieContainer.

from MSDN

...You must always create a CookieContainer to send with a request if you want cookies to be returned on the response. This is also true for HTTPOnly cookies, which you cannot retrieve.

Claudio Redi
A: 

The purpose of the HttpOnly flag is to protect a cookie from a client-side script. For this reason, there is no way to retrieve them.

When an HttpOnly cookie is received by a compliant browser, it is inaccessible to client-side script.

Kevin Panko
A: 

damn :( But Web browsers can retrieve them, isnt it ?

krisox
No they can't retrieve them.
Darin Dimitrov
Yes, the browser has the cookie, but it will only send it back to the web server. It will not allow Javascript, or Silverlight, to see these cookies.
Kevin Panko