Prevent linking to wrong page for logouts
* #410, #1625, #1498
Merge pull request #2873 from acabunoc/login

More login work
Again - merging for staging testing