You clould pass the reference of the Session component to the model's
function.
Controller:
$this->myModel->myModelMethod( $this->Session );

Model:
function myModelMethod( &$sessionComponent ){
$sessionComponent->read( 'session.var' );
}

It should work, theoretically

On 30 Mar, 17:07, "fr3nch13" <[EMAIL PROTECTED]> wrote:
> Is there a way to access the session component in a model?
>
> I store a user's information in the session [$this->Session->read('User')] 
> and when the user edit's their information, i want it
>
> to be able to update the session. I would do it in the controller, but
> there are 3 different ways to edit a user's information (long story..
> had to be like this.) Because of this, i was trying to use the model's
> afterSave() method to update the session, but i am getting an error
> saying this->Session isn't available in the model. Anyone have any
> ideas on how to do this?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to