Loop through CookieContainer

Posted on 2009-12-21
Last Modified: 2012-05-08

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??
Question by:badalpatel
    1 Comment
    LVL 2

    Accepted Solution

    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

    Open in new window


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now