Hi,
I have a similar problem. I recently upgraded PHP (to clean up code for the new register_globals change in 4.2) and have PHP4.1.2 and Apache/1.3.24 running on Linux (FreeBSD, RedHat etc) I have various virtual hosts running on the server in question with almost the same login process as you mention.
These servers have been running for over a year perfectly fine with the same configuration on my previous dev system and on two live servers on older versions of php4 - one has been upgraded to 4.1.2 and has no problems with the identical code.
However, my upgraded dev system (installed in exactly the same fashion as a previously working server with identical php coded pages) does not seem to pass session variables through when using the virtual hosted sites. Even the test $count example in the manual does not work as it used to and does on my old and upgraded servers.
The interesting thing here is that the scripts DO work in the primary host on the same system... The moment you move the code to a virtually hosted (name based) site on the server, the sessions do not carry over.
I am at a loss about what to do next as I have already tried various things (some stupid, some possible) from Apache AllowOverride settings, to --enable-trackvars (suplerflous with 4.1.2) to enabling register_globals in various combinations. I have recompiled PHP and Apache step by step with identical settings to those on the working servers but nothing seems to make the scripts work on the virtual hosts.
Any help would be appreciated