Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8811009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:15:26+00:00 2026-06-14T03:15:26+00:00

I get cookie from InternetGetCookieEx on DownloadComplete WebBrwoser. When trying to login to hotmail

  • 0

I get cookie from InternetGetCookieEx on DownloadComplete WebBrwoser. When trying to login to hotmail it get’s through but then get’s redirected. Even though Gmail works.
I am trying to figure out a universal solution to transfer Authenication from WebBrowser to IdCookieManager for Web Parsing.

Test Project = http://www.megafileupload.com/en/file/373536/Cookie-Tester-rar.html

Cookies aswell as redirects are enabled on IdHTPP.

Cookies must be allowed Your browser is currently set to block
cookies. Your browser must allow cookies before you can use Windows
Live ID.

    function GetCookie(host: string): string;
    const
      INTERNET_COOKIE_HTTPONLY = 8192;
    var
      hModule: THandle;
      lp: Pointer;
      InternetGetCookieEx: function(lpszUrl, lpszCookieName, lpszCookieData
        : PAnsiChar; var lpdwSize: DWORD; dwFlags: DWORD; lpReserved: pointer)
        : BOOL; stdCall;
      CookieSize: DWORD;
      CookieData: PAnsiChar;
    begin
      LoadLibrary('wininet.dll');
      hModule := GetModuleHandle('wininet.dll');
      if hModule <> 0 then
      begin
        @InternetGetCookieEx := GetProcAddress(hModule, 'InternetGetCookieExA');
        if @InternetGetCookieEx <> nil then
        begin
          CookieSize := 1024;
          Cookiedata := AllocMem(CookieSize);
          if InternetGetCookieEx(PAnsiChar(AnsiString(host)), nil, Cookiedata, CookieSize, INTERNET_COOKIE_HTTPONLY, nil) then
          result:=cookiedata;
          FreeMem(Cookiedata);
        end;
      end;
    end;

procedure EmbeddedWB1DocumentComplete(ASender: TObject; const pDisp: IDispatch;
  var URL: OleVariant);
var
  document: IHTMLDocument2;
  cookies: TStringList;
  uri: TIdURI;
begin
  document := EmbeddedWB1.Document as IHTMLDocument2;
  cookies := TStringList.Create;
  try 
    cookies.Delimiter:=';';
    //cookies.DelimitedText:=GetCookie(document.url);
    cookies.DelimitedText:=document.cookie;
    uri := TIdURI.Create(document.url);
    try
      IdCookieManager1.AddServerCookies(cookies,uri);
      EmbeddedWB1.LoadFromString(http.Get(document.url));
    finally
      uri.Free;
    end;
  finally
    cookies.Free;
  end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:15:27+00:00Added an answer on June 14, 2026 at 3:15 am

    As I mentioned in your other question, you need to pre-parse the cookies you are extracting from the web browser. It is not enough to simply split the cookie string as-is on ; characters, since that delimiter is used to both delimit individual cookies from each other as well as delimit name=value data from parameter data within a single cookie. If you just split the entire string without taking that into account, your TStringList is not going to end up with correct cookie data, so you end up passing bad data to TIdCookieManager.

    You might also consider using the NavigateComplete/2 events, as the DocumentComplete event might be too late when redirects are involved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get information from a cookie into Alfresco Share. I have a
When coming back from the Facebook JS SDK login() call I get a cookie
I'm trying to get a certain cookie in a java client by creating a
I am trying to post some data and get some data back from a
I am trying to automatically fill a form from cookie data if the user
How can i get the cookie contents from a URL in java ? Eg:
I want to send request to j_security_check from servlet and get auth cookie from
I can get an Authentication cookie from a SharePoint site that is not using
I'm trying to encrypt some (cookie) data in C# and then decrypt it in
How can i get the latest cookie sent from a domain ? eg :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.