Log into a website and maintain session using Indy in Delphi

here is the schematics/solution (with example):


  1. get the page
  2. save the cookies
  3. set cookies (manualy upto indy 9 at least)
  4. do the login
  5. get and update the cookies
  6. from now on, always set cookies (point 3) just before geting/posting/heading/etc from that site


solution (compile in Delphi 7; indy 9 - there are some issues in delphi 10 not yet fixed)

Source Code