Lockable sessions

Ability to lock session as discussed in issue #29