Monday, December 29, 2014

Joomla jos_session problem

The use of CMS in the web world are now widely used. Ease of managing the content of the web and many features provided, greatly helps web designer to create beautiful view of the web. Likewise with me were very keen to use the CMS. In case this is Joomla is arguably the most popular of several existing CMS. Some time ago there was a bit of a problem arising from the web that I manage. Error message is like this:
This is because jos_session is used to manage user sessions, so it is written to frequently. The most common cause of a corrupted table is a failed write. When the server runs out of resources, it is usually in the middle of a write, This the corrupt jos_session table.
After looking at several forums references and do some experiments there is a solution that might help to resolve the problem of the session. The first solution is to delete and re-create jos_session table using SQL commands:
DROP TABLE IF EXISTS `jos_session`;
CREATE TABLE IF NOT EXISTS `jos_session` ( `username` varchar (150) default '', `time` varchar (14) default '', `session_id` varchar (200) NOT NULL default '0', `guest` tinyint (4) default '1', userid` `int (11) default '0', `usertype` varchar (50) default '', `gid` tinyint (3) unsigned NOT NULL default '0', `client_id` tinyint (3) unsigned NOT NULL default '0', `data` LONGTEXT, PRIMARY KEY (`session_id` (64)), KEY `whosonline` (guest``, `usertype`), KEY `userid` (` userid`), KEY `time` (` time`) ) ENGINE = MyISAM DEFAULT charset = utf8;
The second solution to fix jos_session table using phpmyadmin: Find Joomla database in phpmyadmin then find table jos_session, repair that table
The third solution by modifying existing files in the directory joomla itself. For this section there are some files that are modified to overcome the problem session:
1. Edit the file libraries / joomla / database / table / session.php
function insert ($ sessionId, $ ClientID)
{ $ url = 'http: //'.$_SERVER [' SERVER_NAME ']. $ _ SERVER [' REQUEST_URI '];
$ this-> session_id = $ sessionId; $ this-> client_id = $ ClientID; $ this-> time = time ();
if ($ this-> guest! = 1 || stristr ($ url, '/ administrator')) $ ret = $ this -> _ db-> insertObject ($ this -> _ tbl, $ this, 'session_id');
if (! $ ret && $ this-> guest! = 1) { $ this-> setError (strtolower (get_class ($ this)). "::". JText :: _ ('store failed'). "
". $ this -> _ db-> stderr ()); return false; } else { return true; } }
 2. Edit the file /index.php
/ ** * CREATE THE APPLICATION * * NOTE: * / $ mainframe = & JFactory :: getApplication ('site');
 Change to:
$ mainframe = & JFactory :: getApplication ('site', array ('session' => false));
The next solution is to change the configuration in Joomla. Joomla by default tracks jos_session session data in the table, as I see you've figured out. However, you can disable this by going Easily to your admin panel - Global Configuration - System - Session Settings and change the session handler from "database" to "None".

And the last is the patience and prayer to overcome the problem.
Read More