Make get/set session thread safe