Joomla 2.5 Disable Sessions for Guest

BIG NOTE: You have to do this mod every time you update your joomla site


[joomla-root]\index.php

Line 27

// Instantiate the application.
$app = JFactory::getApplication('site',array('session'=>false));



=================================================

[joomla-root]\libraries\joomla\session\session.php


Line 446 (Line 511 on Joomla Version 2.5.6)


protected function _start()
{
//check back-end url
$url = $_SERVER["REQUEST_URI"];
$pieces = explode("/", $url);

if(in_array ('administrator',$pieces) == true ){

// Start session if not started
if ($this->_state == 'restart') {
session_id($this->_createId());
} else {
$session_name = session_name();
if (!JRequest::getVar($session_name, false, 'COOKIE')) {
if (JRequest::getVar($session_name)) {
session_id(JRequest::getVar($session_name));
setcookie($session_name, '', time() - 3600);
}
}
}

session_cache_limiter('none');
session_start();
}
return true;
}



======================================

Remove Hit Counter in articles

\components\com_content\models\article.php


Line 241

public function hit($pk = 0)
{
 /*            $hitcount = JRequest::getInt('hitcount', 1);

            if ($hitcount)
            {
                // Initialise variables.
                $pk = (!empty($pk)) ? $pk : (int) $this->getState('article.id');
                $db = $this->getDbo();

                $db->setQuery(
                        'UPDATE #__content' .
                        ' SET hits = hits + 1' .
                        ' WHERE id = '.(int) $pk
                );

                if (!$db->query()) {
                        $this->setError($db->getErrorMsg());
                        return false;
                }
            } */

            return true;
}


=================================