How to set/get session value in Joomla! CMS?

Now, it’s time to learn how to use sessions in Joomla!
If you want save some information in session or get some value from session then you can use $session = JFactory::getSession();
Example ↓

$param_value = 'test session text'; // Note: also, you can store objects and arrays
$session = JFactory::getSession();
$session->set('param_value_name',$param_value); // set session value
$param_value = $session->get('param_value_name'); // get session value

More about JSession here: About JSession
Also, you cas see article about set/get cookies in Joomla!