Twebbrowser and Httponly cookie

Asked

Viewed 164 times

0

How to get the Httponly cookie from Twebbrowser? when logging into a page by IE, Firefox, or Chrome I see the following cookie:

Cookie:_ga=GA1.3.2133370562.1518083464; _gid=GA1.3.1396320410.1518629322; _Gat=1; JSESSIONID=Qfh5hg0twtphv6n2b6mt57d561rqzgqrlcb0b1322kz49pp1r44g! 1012588258!NONE

Twebbroser shows me only

Cookie:_ga=GA1.3.2133370562.1518083464; _gid=GA1.3.1396320410.1518629322; _Gat=1

It lacks the JSESSIONID, I verified that it is for security reasons, but I saw that there is way to get, more what I found did not work, some idea?

  • mais o que achei não funcionou body???

1 answer

0

After a lot of searching I found the solution, go to whoever needs it:

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;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.