There is a possibility that either you did not reload the page in the first module, but tried to establish a session and access the session in the second module.
so first try reloading the same page in the first module and assigning a session or you should use the following code in the second module
$getCompID = JRequest::getVar('compID');
$session =& JFactory::getSession();
$session->set('comID', $getCompID);
echo $session->get('comID');
Pass your variable in "compID" to the second module and try to establish a session there
source share