add session_pages as an exported function