More information about the issue, since the database session uses a model to handle the reading/writing I inserted some lines to log data in model.php beforeSave function. The result is that almost after every call to session->Write I see two lines in the log files, beforeSave is being called twice!!
Lets say I have a varible named myvar that I increment from 2 to 3, then I see it's trying to save the session model twice, onw with the value myvar=3 and other with myvar=2. Sometimes it writes the correct value twice. There is only one action that writes that session variable. I thought it could be a cahce issue, but with caching disabled I get the same wrong results. regards On 18 jun, 00:10, dtemes <[email protected]> wrote: > I have a strange issue with sessions while using database to store > them, in some cases the session data is not being updated after a > $this->Session->write. > > I put some $this-log() calls in the cake_sessions.php library file and > the write function returns true but a mysql query shows the old value. > I have tried to add some logging in the __write function that updates > the session model but using $this->log is not possible in the write > handler. > > On the other hand I can see some messages in the error log: > > 2010-06-17 22:57:41 Warning: Warning (2): Cannot unset offset in a non- > array variable in [/var/www/clients/client1/web15/cakephp-cakephp- > f9c1d47/cake/libs/model/model.php, line 1285] > 2010-06-17 22:57:41 Warning: Warning (2): Invalid argument supplied > for foreach() in [/var/www/clients/client1/web15/cakephp-cakephp- > f9c1d47/cake/libs/model/model.php, line 1289] > > this does not happen if using php or cake sessions. Here are my cake > settings: > > Configure::write('Session.save', 'database'); > Configure::write('Session.model', 'Session'); > Configure::write('Session.table', 'cake_sessions'); > Configure::write('Session.database', 'default'); > Configure::write('Session.cookie', 'ASDASDASD234234'); > Configure::write('Session.timeout', '120'); > Configure::write('Session.start', true); > > To make things even more difficult the problematic actions are called > from within a flash application and return xml. > > Any hints to help me debug the issue will be appreciated Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
