Detach from sessions before attaching.