consolidate heartbeat and session functionality in session to prevent circular loops