On 5/17/07, jyrgen <[EMAIL PROTECTED]> wrote:
> // ... password validation succeeded ....
> ...
> // custom session garbage collection
> //
> $sessions = $this->Mysession->findAll();
> foreach($sessions as $session){
> if($session['Mysession']['expires']<time()){
> $this->Mysession->del($session['Mysession']['id']);
> }
> }
I would run a findall to select only those with
$session['Mysession']['expires']>time() and loop over those. Garbage
collection is handled by PHP and you need not write your own - even if
you insist I would say it would be easier to write a custom SQL query
and delete in one fell swoop instead of looping...
> // check to see, if account is in use
> //
> $account_in_use = false;
Among other things wouldn't it be more efficient to have a timestamp
in the user table which is updated in beforeFilter? and checked at
login time?
But hey if it works for you then GREAT - it all depends on your requirements :)
Cheers
Tarique
--
My motto for everyone else - "Just shut up, damnit!!"
=============================================================
PHP for E-Biz: http://sanisoft.com
=============================================================
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---