Gui 1258 fix for user-set-password bug in 4.0.2

I fixed the complaint by applying fix I already applied in login.py
I found another problem where an expired password at login caused a session to be created that misses some required variables (and fixed that as well)