hrm... what about you try save the login page html onto your hard drive, edit it to add in a <BASE HREF="http://domain.com/path/to/cgi"> in the html (so that the url's still work), and try logging in that way? Don't know if it will help any but worth a try I guess.
Adrian
Adrian