Re: debugging database sessions in cake 1.3.1

2010-07-17 Thread phpdeve
Hi,

I have even strange issue with session database. I have exactly same
configuration as mentioned here. My issue is that the sessions are
stored on both /tmp and the database cake_sessions table. Any idea how
to prevent storing session data in tmp folder?

On Jun 22, 1:38 pm, dtemes  wrote:
> bump, seems that nobody is having issues with sessions stored in
> database?
>
> On 18 jun, 09:44, dtemes  wrote:
>
> > 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  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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: debugging database sessions in cake 1.3.1

2010-06-22 Thread dtemes
bump, seems that nobody is having issues with sessions stored in
database?

On 18 jun, 09:44, dtemes  wrote:
> 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  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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: debugging database sessions in cake 1.3.1

2010-06-18 Thread dtemes
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  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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


debugging database sessions in cake 1.3.1

2010-06-17 Thread dtemes
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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en