Re: Session fatal error (database gc)

2007-04-25 Thread Damien

> That is in the core code. Since some install of Linux, namely Debian, Ubuntu
> from what I have seen so far, turn off gc for sessions by default and use a
> cron job to clean them up. Since database session handling relies on the
> normal cleanup PHP uses I had to create a workaround at the framework level
> to handle this on database. I have not checked yet, but it may even effect
> storing sessions anywhere but the php default.

For the record, I've encountered (what I presume to be) this error on
CentOS4. I've copied the changes from the trac ticket into my codebase
and it seems to have helped :)

Damien


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Session fatal error (database gc)

2007-04-12 Thread jyrgen

does that mean that on a debian system these settings
have no effect ?

session_set_save_handler(array('CakeSession','__open'),
array('CakeSession', '__close'),
array('CakeSession', '__read'),
array('CakeSession', '__write'),
array('CakeSession', '__destroy'),
array('CakeSession', '__gc'));

and

ini_set("session.gc_probability",1);
ini_set("session.gc_divisor",100);

respectively.

at least on my ubuntu i couldn't find any cron jobs which interfere
with cake's database driven session handling.

cheers, jyrgen


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: Session fatal error (database gc)

2007-04-12 Thread Larry E. Masters aka PhpNut
That is in the core code. Since some install of Linux, namely Debian, Ubuntu
from what I have seen so far, turn off gc for sessions by default and use a
cron job to clean them up. Since database session handling relies on the
normal cleanup PHP uses I had to create a workaround at the framework level
to handle this on database. I have not checked yet, but it may even effect
storing sessions anywhere but the php default.

And the issue in the original email was reported to trac and fixed. Please
use that site, as I have mentioned numerous times before, to report issues
with the code. I do not follow this list often or even consider anything
reported here a bug

https://trac.cakephp.org/ticket/2387


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Re: Session fatal error (database gc)

2007-04-12 Thread jyrgen

> Fatal error: Using $this when not in object context in C:\AppServ\www
> \cake\libs\session.php on line 365

strange... is this your own private __close method or does
it come from the cake session lib.

please post some more code and explain your custom __gc,
maybe then i can help.

why experimenting with probability ? why random ?

hm..

jyrgen


> function __close() {
> $probability = mt_rand(1, 150);
> if($probability <= 3) {
> $this->__gc();
> }
> return true;
> }


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Session fatal error (database gc)

2007-04-11 Thread majna

There is an error when session is set to database :
Is it bug? Can one confirm?

cake_1.1.14.4797


Fatal error: Using $this when not in object context in C:\AppServ\www
\cake\libs\session.php on line 365

To reproduce this error set $probability =1 in:
/**
 * Method called on close of a database
 * session
 *
 * @return boolean
 * @access private
 */
function __close() {
$probability = mt_rand(1, 150);
if($probability <= 3) {
$this->__gc();
}
return true;
}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---