Not sure if its the same problem, havent read through all your
explanation...
However I had same error:
Error: Table sessions for model Session was not found in datasource default.
My solution was adding following line to my
/app/Controller/AppController.php:
public $components = array('Session');
Den fredag den 6. juli 2012 18.22.23 UTC+2 skrev harrije:
>
> I posted this problem on stackoverflow because it has lots of cakePHP
> discussion and I usually get an answer in a few hours, but I've gotten no
> quick answers on the issue below. Read on...
>
> I need to implement a custom session that is very similar to the
> ComboSession example used in the cakePHP online book at
> http://book.cakephp.org/2.0/en/development/sessions.html . After making
> the changes shown in the book, I get the following error:
>
> Missing Database Table
> Error: Table sessions for model Session was not found in datasource default.
>
> Stack Trace
> CORE\Cake\Model\Model.php line 3180 ? Model->setSource(string)
> CORE\Cake\Model\Model.php line 2631 ? Model->getDataSource()
> CORE\Cake\Model\Datasource\Session\DatabaseSession.php line 95 ?
> Model->find(string, array)
> APP\Model\Datasource\Session\ComboSession.php line 18 ?
> DatabaseSession->read(string)
> [internal function] ? ComboSession->read(string)
> CORE\Cake\Model\Datasource\CakeSession.php line 615 ? session_start()
> CORE\Cake\Model\Datasource\CakeSession.php line 189 ?
> CakeSession::_startSession()
> CORE\Cake\Model\Datasource\CakeSession.php line 399 ? CakeSession::start()
> CORE\Cake\Controller\Component\SessionComponent.php line 56 ?
> CakeSession::write(string, integer)
> APP\Controller\ProductsController.php line 12 ?
> SessionComponent->write(string, integer)
> [internal function] ? ProductsController->index()
> CORE\Cake\Controller\Controller.php line 485 ?
> ReflectionMethod->invokeArgs(ProductsController, array)
> CORE\Cake\Routing\Dispatcher.php line 186 ?
> Controller->invokeAction(CakeRequest)
> CORE\Cake\Routing\Dispatcher.php line 161 ?
> Dispatcher->_invoke(ProductsController, CakeRequest, CakeResponse)
> APP\webroot\index.php line 92 ? Dispatcher->dispatch(Ca keRequest,
> CakeResponse)
>
>
> CakePHP doesn't like the 'model' entry in the core.php changes that the
> book example says to do:
>
> Configure::write('Session', array(
> 'defaults' => 'database',
> 'handler' => array(
> 'engine' => 'ComboSession',
> 'model' => 'Session',
> 'cache' => 'apc'
> )
> ));
>
>
> The only way I could get ComboSession to work was to add a new default
> entry in lib/Cake/Model/Datasource/CakeSession.php in function
> _defaultConfig as:
>
> 'combo' => array(
> 'cookie' => 'CAKEPHP',
> 'timeout' => 240,
> 'ini' => array('session.use_trans_sid' => 0, 'url_rewriter.tags' => '',
> 'session.auto_start' => 0, 'session.use_cookies' => 1, 'session.cookie_path'
> => self::$path, 'session.save_handler' => 'user', 'session.serialize_handler'
> => 'php'),
> 'handler' => array(
> 'engine' => 'ComboSession',
> 'model' => 'Session',
> 'cache' => 'apc',
> )
> )
>
>
> The above combo default entry is the same as the database default entry,
> except that the engine is change to ComboSession and cache is also included.
>
> After making the cake lib change, I was able to use the ComboSession after
> changing core.php to:
>
> Configure::write('Session', array(
> 'defaults' => 'combo',
> ));
>
> I also tried using the DatabaseSession, which uses model Session, and it
> worked just fine with no error.
>
> So why can't I get ComboSession working with the core.php changes
> described in the online book? Why does it work after making lib changes,
> instead of app only changes? I understand that app only changes are
> preferred and lib changes are to be avoided.
>
> Please advise!
>
>
>
>
>
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.