added ability to flush session.