Created 'tmu' function which attaches or creates a session.