URL::readEntireTextStream() inconsitent across platforms

The backend is made with Ruby on Rails.

Your solutions seem legit but I am still bumping my head against the fact that the same code project has been compiled by myself 2 years ago and successfully logs in, even today.

Before I go to so much work, is there a way to send back the cookies on windows using WinInet?