Issue 346 keeploggedin string to master-ios-integration branch

This has been merged to master, but will need to be integrated with the master-ios-integration-branch, at which this pull is aimed.

To ease the way, I've merged master-ios-integration-branch to it and resolved the conflicts, confirmed tests, etc. I've also established that there are no conflicts, test failures, overt malfunctions when merging into the integration branch along with #371, the login-backout stuff.