• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database session - No database selected

I was going to ask this question but fortunately found the answer by digging into the session handler file.

The main issue is that the documentation doesn't mention yet about this property in the App.php

public $sessionDBGroup

As in my case, in the config/Database.php - I have two groups "development" and "production" i.e. no "default" group because I had set $defaultGroup = ENVIRONMENT; . This created issue for me as \CodeIgniter\Session\Handlers\DatabaseHandler file was looking for database name in the "default" group.

$this->DBGroup = ! empty($config->sessionDBGroup) ? $config->sessionDBGroup : 'default';

If you happen to have the same issue, then all you need to do is that in you App.php just add public $sessionDBGroup = ENVIRONMENT; or name of whatever database group you are using.

Hope that helps anyone having similar issue.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.