It is necessary to go to the browser from a program written in C ++ Builder. First, I log in on the page I plan to go to:

TStringList *SL = new TStringList; IdHTTP1->HandleRedirects =True; IdHTTP1->CookieManager = IdCookieManager1; IdHTTP1->AllowCookies = true; String Url = "http://host/auth"; SL->Add("login=login"); SL->Add("password=password"); try { Memo1->Text = IdHTTP1->Post(Url, SL); ShellExecute(Handle, L"open", L"http://host/auth", NULL, NULL, SW_SHOW); } catch(EIdException &E) { ShowMessage("Ошибка:\n" + E.Message + ""); }; delete SL; 

After authorization, I get the html code of the page I need, which is displayed in the memo.

Question: How to open a page on which my authorization has already passed in the browser? Or how to make the browser understand that the final page opens an already authorized client?

  • and where does php? - Naumov
  • And how the server remembers authorization? If through any session-id in a cookie, then you need to get it and somehow save it to the browser storage. If otherwise, then look like. IMHO it will be easier to authorize not through indie, but somehow force the browser to send the necessary request to the server. - Alekcvp

0