Solved. It seems that after traversal, the $_SESSION['vmPassword']
value was getting corrupted somewhere. Using a local value set to
$_SESSION['vmPassword'] somehow removed the corruption of the session
value. It probably corrupted the local value (somehow????), but since
it was reset each time, I didn't care.