Users and sessions

Merging users and sessions stuff to master.