user login redir: clarify logic, fix test

refs #3552
Merge remote-tracking branch 'origin/7.x-1.x' into 7.x-1.x

Bringing up-to-date with upstream