On Fri, Jun 26, 2009 at 2:31 PM, KimG<[email protected]> wrote:
>
> Hi,
>
> i have some great problems getting Zend::session to work.
>
> i started out with the simple usage of Zend::session but it doesn't work.
>
> so i decided to use a database as a backend instead.
>
> i have the following in my bootstrap (taken directly from the zend docs):
>
> $db = Zend_Db::factory('Pdo_Mysql', array(
>    'host'        =>'localhost',
>    'username'    => 'abc,
>    'password'    => 'def',
>    'dbname'    => 'mybase'
> ));
>
> $config = array(
>    'name'           => 'session',
>    'primary'        => 'id',
>    'modifiedColumn' => 'modified',
>    'dataColumn'     => 'data',
>    'lifetimeColumn' => 'lifetime',
>    'db'             => $db
> );
> Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable($config));
> Zend_Session::start();
>
>
> when i point my browser at the index link i get the page but a warning is
> dispalyed too:
>
> Warning: session_write_close() [function.session-write-close]: Failed to
> write session data (user). Please verify that the current setting of
> session.save_path is correct (/var/lib/php/session) in
> /usr/share/Zend/library/Zend/Session.php on line 651
>
>
> what does it mean and how can i aleviate it? nothing is inserted into the
> database table.
>
> i now the db setup is correct so that's not the reason.
>
> kim

Hey Kim,

Zend_Session is a bit tedious to work with. Generally, it should throw
exceptions whenever things go wrong -- e.g., even a warning is
converted to an exception. Maybe you can write a small script and step
through it? Another thing would be to write a small unit test and see
what it "says".

Btw, did you verify that the created table matches your definition, etc.?

Last but not least -- I've never looked into the
Zend_Session_Savehandler_DbTable, because we wrote our own -- but
maybe it's thrown an exception somewhere which is not caught or maybe
silenced. Could also be the root cause to your problem. For whatever
reason. Step-through debugging would be the best method here.

Till

Reply via email to