Added session ping to prevent invisible timeouts

Also added logger for easier debugging