Allow sessions to be re-attached.

Issue #226.