Improve support for two-factor auth + active session handling

Tested these changes against two VPNs running software release 7.2r5 and 8.0r5. If you could test on other versions, I would appreciate it.

VPNs that I use for work requires explicit two-factor authentication on the same form. I understand that this may not fit every use case, so probably needs some review on other configurations. We have a number of people using this version daily without major issues.