Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which .NET class parses a multiple HTTP cookies string into a CookieCollection or CookieContainer?

Tags:

.net

http

cookies

I am sure it already exists somewhere, just can't find it.

like image 244
Jader Dias Avatar asked Aug 08 '09 17:08

Jader Dias


People also ask

What is CookieContainer?

A CookieContainer is a data structure that provides storage for instances of the Cookie class, and which is accessed in a database-like manner. The CookieContainer has a capacity limit that is set when the container is created or changed by a property.

What is cookies and types of cookies in asp net?

Cookies is a small piece of data stored on a client browser. There are three types of Cookies - Persist Cookie, Non-Persist Cookie. In this article, we will see how to create a cookie in ASP.NET. We'll also see how to retrieve data from a cookie using ASP.NET.

What is a cookie constructor?

Initializes a new instance of the Cookie class with a specified Name and Value. Cookie(String, String, String) Initializes a new instance of the Cookie class with a specified Name, Value, and Path.


1 Answers

I think it sounds like you want the CookieContainer.SetCookies method:

  • http://msdn.microsoft.com/en-us/library/system.net.cookiecontainer.setcookies.aspx

Followed by the CookieContainer.GetCookies method to get the parsed CookieCollection:

  • http://msdn.microsoft.com/en-us/library/system.net.cookiecontainer.getcookies.aspx
like image 75
mckamey Avatar answered Sep 19 '22 10:09

mckamey