php - Yii - CDbHttpSession, session table before login -


i follow this tutorial create user online list.
in local mamp server on mac osx work fine, if tried put in ubuntu server, got error (at index, without logged in):

fatal error: uncaught exception 'cdbexception' message 'cdbcommand failed    execute sql statement: sqlstate[42s01]: base table or view exists: 1050 table 'session' exists. 

i can catch exception know because in osx works fine in ubuntu it's not works.

i think may in apache or other config: possible ?
session created before login ? component need user_id (not null) in session table think there don't understand.
in both php.ini set session.auto_start = 0.

probably problem in 2 servers have slight differences, , among them table 'session' available in ubuntu server, , handled total different reason against need, while in mac env there no such thing 'session' table.

the easy , clean way can think of solve collision of names rename table name 'session' 'mysession' changing config setting way:

'session' => array (   'class' => 'application.components.dbhttpsession',   'connectionid' => 'db',   'sessiontablename' => 'mysession',   'usertablename' => 'user' ), 

and update every occurrence of table name (like in queries) in code. way collision should gone , should work fine. hope helps.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -