issue 1253 - prevent multiple logins with same username

Resolves #1253 
`for (auto item : list)`