So the session table isn't being created when you use sqlite as the database type. This patch fixes the problem and allows successful login.
--- sqlite.initial.sql.orig 2005-10-30 09:54:13.000000000 -0800 +++ sqlite.initial.sql 2005-10-30 09:08:17.000000000 -0800 @@ -78,3 +78,19 @@ language varchar(5) NOT NULL default 'en', preferences text NOT NULL default '' );
+-- --------------------------------------------------------
+-- +-- Table structure for table sessions +--
+CREATE TABLE session (
+)
Adhamh
Hmm, from the source (main.inc), it looks like the authors intentionally didn't want to have sqlite handle session management.
// we can use the database for storing session data if (is_object($DB) && $DB->db_provider!='sqlite') include_once('include/session.inc');
I've never used sqlite, so I wouldn't presume to guess why they made this decision.
I am using PHP 4.3.10 on apache 1.13.34 with MySQL 4.1.15 and I'm have the same 'Your session is invalid or expired' error. I just installed RoundCube last night, so I haven't spent much time debugging, but from what I can see, the session table is created, however sessions aren't created. The user is added to the users table as well as the identities table. Cache and contacts are also empty (which isn't surprising at this point).
If anyone has an idea as to what the problem is, I'd love to hear it.
-- Dave Wood
On 30/10/05, Adhamh Findlay pmi@adhamh.com wrote:
So the session table isn't being created when you use sqlite as the database type. This patch fixes the problem and allows successful login.
--- sqlite.initial.sql.orig 2005-10-30 09:54:13.000000000 -0800 +++ sqlite.initial.sql 2005-10-30 09:08:17.000000000 -0800 @@ -78,3 +78,19 @@ language varchar(5) NOT NULL default 'en', preferences text NOT NULL default '' );
+-- --------------------------------------------------------
+-- +-- Table structure for table sessions +--
+CREATE TABLE session (
- sess_id varchar(32) NOT NULL default '',
- created datetime NOT NULL default '0000-00-00 00:00:00',
- changed datetime NOT NULL default '0000-00-00 00:00:00',
- ip VARCHAR(15) NOT NULL default '',
- vars text NOT NULL,
- PRIMARY KEY (sess_id)
+)
Adhamh
Hello list,
I followed your discussion and finally found the problem with session expiration when using SQLite. RoundCube does not use SQLite for session management, because I thought that it's file-based anyway and we can use the default session management of PHP.
But I made a mistake when adding the check for session timeout. The global var $SESS_CHANGED is only available when using the DB backend for sessions. If using SQLite the check fails and returns a "session expired" message.
To fix this, you can either use the patch posted here to create a sessions table in SQLite and then change the line 68 in program/include/main.inc from if (is_object($DB) && $DB->db_provider!='sqlite') to if (is_object($DB))
or you replace the whole index.php file with the latest CVS version: http://cvs.sourceforge.net/viewcvs.py/*checkout*/roundcubemail/roundcubemail...
Regards, Thomas
Adhamh Findlay wrote:
So the session table isn't being created when you use sqlite as the database type. This patch fixes the problem and allows successful login.
--- sqlite.initial.sql.orig 2005-10-30 09:54:13.000000000 -0800 +++ sqlite.initial.sql 2005-10-30 09:08:17.000000000 -0800 @@ -78,3 +78,19 @@ language varchar(5) NOT NULL default 'en', preferences text NOT NULL default '' );
+-- --------------------------------------------------------
+-- +-- Table structure for table sessions +--
+CREATE TABLE session (
- sess_id varchar(32) NOT NULL default '',
- created datetime NOT NULL default '0000-00-00 00:00:00',
- changed datetime NOT NULL default '0000-00-00 00:00:00',
- ip VARCHAR(15) NOT NULL default '',
- vars text NOT NULL,
- PRIMARY KEY (sess_id)
+)
Adhamh
Thanks! The new index.php file fixed my session expired messages also, and I am using MySQL, not sqlite.
-- Dave Wood
On 02/11/05, Thomas Bruederli roundcube@gmail.com wrote:
Hello list,
I followed your discussion and finally found the problem with session expiration when using SQLite. RoundCube does not use SQLite for session management, because I thought that it's file-based anyway and we can use the default session management of PHP.
But I made a mistake when adding the check for session timeout. The global var $SESS_CHANGED is only available when using the DB backend for sessions. If using SQLite the check fails and returns a "session expired" message.
To fix this, you can either use the patch posted here to create a sessions table in SQLite and then change the line 68 in program/include/main.inc from if (is_object($DB) && $DB->db_provider!='sqlite') to if (is_object($DB))
or you replace the whole index.php file with the latest CVS version:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/roundcubemail/roundcubemail...
Regards, Thomas
Adhamh Findlay wrote:
So the session table isn't being created when you use sqlite as the
database
type. This patch fixes the problem and allows successful login.
--- sqlite.initial.sql.orig 2005-10-30 09:54:13.000000000 -0800 +++ sqlite.initial.sql 2005-10-30 09:08:17.000000000 -0800 @@ -78,3 +78,19 @@ language varchar(5) NOT NULL default 'en', preferences text NOT NULL default '' );
+-- --------------------------------------------------------
+-- +-- Table structure for table sessions +--
+CREATE TABLE session (
- sess_id varchar(32) NOT NULL default '',
- created datetime NOT NULL default '0000-00-00 00:00:00',
- changed datetime NOT NULL default '0000-00-00 00:00:00',
- ip VARCHAR(15) NOT NULL default '',
- vars text NOT NULL,
- PRIMARY KEY (sess_id)
+)
Adhamh
Very nice! Now I will start tinkering with Address Book and try to get it to read from an LDAP server. (No promises on a deliverable though! :-)
Adhamh
On 11/1/05 10:38 PM, "Thomas Bruederli" roundcube@gmail.com wrote:
Hello list,
I followed your discussion and finally found the problem with session expiration when using SQLite. RoundCube does not use SQLite for session management, because I thought that it's file-based anyway and we can use the default session management of PHP.
But I made a mistake when adding the check for session timeout. The global var $SESS_CHANGED is only available when using the DB backend for sessions. If using SQLite the check fails and returns a "session expired" message.
To fix this, you can either use the patch posted here to create a sessions table in SQLite and then change the line 68 in program/include/main.inc from if (is_object($DB) && $DB->db_provider!='sqlite') to if (is_object($DB))
or you replace the whole index.php file with the latest CVS version: http://cvs.sourceforge.net/viewcvs.py/*checkout*/roundcubemail/roundcubemail... ndex.php?rev=1.19
Regards, Thomas
Adhamh Findlay wrote:
So the session table isn't being created when you use sqlite as the database type. This patch fixes the problem and allows successful login.
--- sqlite.initial.sql.orig 2005-10-30 09:54:13.000000000 -0800 +++ sqlite.initial.sql 2005-10-30 09:08:17.000000000 -0800 @@ -78,3 +78,19 @@ language varchar(5) NOT NULL default 'en', preferences text NOT NULL default '' );
+-- --------------------------------------------------------
+-- +-- Table structure for table sessions +--
+CREATE TABLE session (
- sess_id varchar(32) NOT NULL default '',
- created datetime NOT NULL default '0000-00-00 00:00:00',
- changed datetime NOT NULL default '0000-00-00 00:00:00',
- ip VARCHAR(15) NOT NULL default '',
- vars text NOT NULL,
- PRIMARY KEY (sess_id)
+)
Adhamh