Handle multiple session tracking modes
Close both sides of the connection on IO error
Fix session tracking mode issue