Upgrading CakePHP 3.0->3.1 will save mondo head scratching about check-boxs/multi-selects not working right for HasAndBelongsToMany.
3.0 will save the relations in the join table, but will not show them as selected on further edits.
All you should need in your view for it to work is:
(Example is Cart HasAndBelongsToMany Items), editing Cart.
$this->Form->input('Item', array('multiple' => 'checkbox'));
$this->Form->input('Item', array('multiple' => true));
And in your controller action