Session

{php} function getSessionID($user_id=null) { if (!empty($user_id)) { $db =& JFactory::getDBO(); $query = “SELECT session_id FROM #__session WHERE userid=”.(int)$user_id; $db->setQuery($query); if($db->loadResult()) { return $db->loadResult(); } } } $user =& JFactory::getUser(); $_SESSION[‘new_session_id’] = getSessionID($user->get(‘id’)); echo $_SESSION[‘new_session_id’]; {/php}