Expand Connection function

Expand Connection function, make sure it logs the session so we can use
it again