Magento using sessions
Even if in PHP using session variables is pretty easy, believe it or not in Magento is even simpler:
To set data
Mage::getSingleton('core/session')->setData('var_name',$somevalue)
To get data
Mage::getSingleton('core/session')->getData('var_name')
Session variables persist between different page loads so you can use this to pass data between pages.