why not simply
```
sessions[s->getUser().ID] = s;
```
?