cross-wm-tool cookie management

surgically injected all the working bits on top of master.