• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 827
  • Last Modified:

Loop through CookieContainer

Hi,

I have CookieContainer variable which is full of cookies.
Now in that i want to read each cookie one by one..

How can i do it??
0
badalpatel
Asked:
badalpatel
1 Solution
 
axtoxic107Commented:
Well as far as i know you can provide the URI address to get cookies of it and loop through it.
Below is the sample code to do it

For Each cook As Cookie In cookies.GetCookies(New Uri(YOur URI))
    secToken = "Cookie:" & cook.Domain
    secToken &= "Cookie:" & cook.Name
    secToken &= "Cookie:" & cook.Path
    secToken &= "Cookie:" & cook.Value
    secToken &= "Cookie:" & cook.CommentUri.ToString
Next

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now