I just tried it again and had to click twice. However I picked up a few clues that might help.
When I click the FIRST window it pops open the SECOND window with a login screen. Toggling back to the FIRST window and clicking again then logs the SECOND window in.
If I CLOSE the SECOND window then push the button on the FIRST window again, it works properly, which means the problem is with reading the session, because closing the FIRST window and forcing a new session to start repeats the process.
HOWEVER, if I turn SESSION COOKIES on (which I do not allow by default), it works PROPERLY from the beginning, which means you have a problem validating the session the first time through using the session in the URL method.