Hi GiJoe,
I am having problems with people not being able to login properly. Some can login using another browser, though most dont try. You mentioned before : Quote:
(3) cookie problem (4) Protector's setting 'Protected IP bits for the session'
how can I fix the ip bits for the session?
how can I go about fixing a possible cookie problem?
do I have to assign cookie paths to assure cookies are being used properly?
Please help!!
thank you much in advance!
auxiv
i dont think it is Protector problem . Try one Of this Methods :
1- Open file session.php found at /Xoops/kernel/session.php
Change line 80 var $enableRegenerateId = false;
to var $enableRegenerateId = true;
if it didt work go to step 2
2- Embty the Table _session and protector_access from database . you can write a php code to make cron file to everyday or every hour embty the table somthing like this code .
<?php
MYSQL_CONNECT('localhost,'dbuser,'password');
@mysql_select_db("dbname") or die(mysql_error());
// The Name of the Tables to embty
$query="TRUNCATE xoops_session";
$query="TRUNCATE xoops_protector_access";
mysql_query($query);
mysql_close()
?>
dont forget change the server name and username and password and db name and the tables name from the code above..
Good luck
I am using XCL (latest). There is no 'enableRegenerateId' on line 80 in session.php. I searched the complete XCL for any 'enableRegenerateId' enteries and nothing came up.
I have a session class in preload that sends session files to a directory instead of database.
Thank you for the cron information by the way, it is useful info.
I do not know why only a few members can *not* log in with internet explorer. Maybe its their security setting in their browser? certain antivirus maybe?
the log in problem never happens to me, is very difficult for me to track. They usually get discouraged and leave the site.
must have something to do with the cookies, although im not sure.
in any event, thanks for helping me with this.
hi,
I am using Legacy_2_1_6.
here are the contents of /kernel/session.php
class XoopsSessionHandler
{
/**
* Database connection
*
* @var object
* @access private
*/
var $db;
/**
* Constructor
*
* @param object &$mf reference to a XoopsManagerFactory
*
*/
function XoopsSessionHandler(&$db)
{
$this->db =& $db;
}
/**
* Open a session
*
* @param string $save_path
* @param string $session_name
*
* @return bool
*/
function open($save_path, $session_name)
{
return true;
}
/**
* Close a session
*
* @return bool
*/
function close()
{
return true;
}
/**
* Read a session from the database
*
* @param string &sess_id ID of the session
*
* @return array Session data
*/
function read($sess_id)
{
$sql = sprintf('SELECT sess_data FROM %s WHERE sess_id = %s', $this->db->prefix('session'), $this->db->quoteString($sess_id));
if (false != $result = $this->db->query($sql)) {
if (list($sess_data) = $this->db->fetchRow($result)) {
return $sess_data;
}
}
return '';
}
/**
* Write a session to the database
*
* @param string $sess_id
* @param string $sess_data
*
* @return bool
**/
function write($sess_id, $sess_data)
{
$sess_id = $this->db->quoteString($sess_id);
list($count) = $this->db->fetchRow($this->db->query("SELECT COUNT(*) FROM ".$this->db->prefix('session')." WHERE sess_id=".$sess_id));
if ( $count > 0 ) {
$sql = sprintf('UPDATE %s SET sess_updated = %u, sess_data = %s WHERE sess_id = %s', $this->db->prefix('session'), time(), $this->db->quoteString($sess_data), $sess_id);
} else {
$sql = sprintf('INSERT INTO %s (sess_id, sess_updated, sess_ip, sess_data) VALUES (%s, %u, %s, %s)', $this->db->prefix('session'), $sess_id, time(), $this->db->quoteString($_SERVER['REMOTE_ADDR']), $this->db->quoteString($sess_data));
}
if (!$this->db->queryF($sql)) {
return false;
}
return true;
}
/**
* Destroy a session
*
* @param string $sess_id
*
* @return bool
**/
function destroy($sess_id)
{
$sql = sprintf('DELETE FROM %s WHERE sess_id = %s', $this->db->prefix('session'), $this->db->quoteString($sess_id));
if ( !$result = $this->db->queryF($sql) ) {
return false;
}
return true;
}
/**
* Garbage Collector
*
* @param int $expire Time in seconds until a session expires
* @return bool
**/
function gc($expire)
{
$mintime = time() - intval($expire);
$sql = sprintf('DELETE FROM %s WHERE sess_updated < %u', $this->db->prefix('session'), $mintime);
return $this->db->queryF($sql);
}
}
there is no $enableRegenerateId
should i add it? is there an alternative way to toggle this function?
thank you very much again for your time and wisdom
i'm sorry but i never used Legacy i cant help you with this one , seem bug the developer should look at , it clear the problem with the cookies , Micrsoft Explorer 7 has some issues witht he Cookies .
For temporary Solution i suggest u use cron file to embty the Session table every Hour ..
thank you for your suggestions.
will have sessions cleared through cron frequently.
thanks again.
this has been resolved by GIJOE.
the only remaining problems were just cached, now no problems.
thank you GIJoe
I cannot read full of your messages, sorry.
Is there some problems with logging into XCL2.1 still?