CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: VB and Cookies

  1. #1
    Join Date
    Jul 1999
    Posts
    10

    VB and Cookies

    Hi,

    I'm trying to write a VB6 app that has a WebBrowser control.

    I use the Webbrowser.Navigate(URL) function to connect to a web site. Cookies are enabled on my machine.

    I need to get hold of the cookie that is created when I goto the web site.

    Any ideas how i can get to the cookie in VB, using this control.

    Cheers
    Mike


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: VB and Cookies

    here is a sample

    option Explicit

    private Sub Command1_Click()
    w.navigate "http:yourURL"
    End Sub

    private Sub w_NavigateComplete2(byval pDisp as Object, URL as Variant)
    Dim d as HTMLDocument
    set d = w.document
    MsgBox d.cookie
    End Sub




    you need to add a reference to the HTML Object Library (MSHTML.DLL) to your project to get acccess to the HTML document in your browser.


  3. #3
    Join Date
    Jul 1999
    Posts
    10

    Re: VB and Cookies

    Thanks for the code. It seems to return a Web escaped cookie. Do you know how to unescape it??

    Cheers
    Mike


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured