Menu

Manage Cookies

Help
Willy
2008-12-17
2013-04-27
  • Willy

    Willy - 2008-12-17

    Hello, I've to connect to a page that needs authentication.
    How can I get the cookie after authentication and how can I pass the cookie to retrieve a page that needs authentication?

     
    • Derrick Oswald

      Derrick Oswald - 2008-12-18

      You should be able to access all you need through the org.htmlparser.http.ConnectionManager class. It is available on the parser as getConnectionManager().

      For example:
        parser.getConnectionManager ().setRedirectionProcessingEnabled (true);
        parser.getConnectionManager ().setCookieProcessingEnabled (true);

      To set a cookie, you could use:
        setCookie (Cookie cookie, String domain)

      Check other methods on this class too.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.