PHP can be tricky about "seeing" the session.
any time you are trying to set or display a session, you should include the following code first to force php to look for the session contents:
if(!session_id()) session_start();
so to set the session use:
<?php
if(!session_id()) session_start();
$_SESSION['COMMID']=$_rsPAGES['page_1'];
?>
then to display it use:
<?php
if(!session_id()) session_start();
echo $_SESSION['COMMID'];
?>
Also, make sure that the code you are using to set the session value is after the code to create the recordset.