2
votes

I have two websites with Codeigniter on one server with two different databases,

for example I have mydom.com and mydom2.com and set my config.php on mydom.com as below :

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_sessions';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'mydom.ci_sessions';
$config['sess_match_ip'] = false;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = false;

and the mydom2 config.php :

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_sessions';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'mydom.ci_sessions';
$config['sess_match_ip'] = false;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = false;

both of them are same, mydom2 is connected to mydom database in line sess_save_path. Session is working , but they are different , when I login in mydom , session is set , but on mydom2 it is not set. Why?

1
Joon baba or notMorteza Rastgoo
joon baba so yesNima habibkhoda
it is not correct because there is no joon baba variable found on the tableMorteza Rastgoo
$joon_baba is not defined in the scopeMorteza Rastgoo
you have to change it to : $config['joon_baba'] = 'jafar';Nima habibkhoda

1 Answers

1
votes

I think You should try with change cookie name and sessions saved table name. Reference link https://www.codeigniter.com/user_guide/libraries/sessions.html#database-driver