Not sure what the "right answer" on your session setup is but I'll tell
you what I have done.
I built an authentication object that holds the user and current
session info as a component.
I add a variable to appmodel to hold a reference to this component in
this case
var $asAuth = false;
Then in the startup for the authentication component i put this code
(also could put similar code in app_controller)
To add a reference to the object in all of the models the controller
uses.
if (isset($controller->uses) && !empty($controller->uses)){
for($i=0;$i<count($controller->uses);$i++){
$controller->{$controller->uses[$i]}->asAuth = &$this;
}
}
This works unless you create the model directly (like from another
model). Also, I always use uses even if it is the natural model for
the controller
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---