Added session locking support