if (_userId == null || userId != _userId) {
Sessiondata sessionData = sessionDao.getSessionByHash(SID);
if (sessionData == null) {
sessionData = sessionDao.startsession();
}
if (!sessionDao.updateUser(sessionData.getSession_id(), userId, false, languageId)) {
//something bad, force user to re-login
invalidate();
} else {
SID = sessionData.getSession_id();
}