Thank you Ryan and Jeremy.

You were right the conditional I used in the view to check if they
were subscribed was stale. I got it working. Initially in my app
controller I was checking if they were subscribed like this:

// returns true if not subscribed
protected function isNotSubscribed() {
   if ($this->Auth->user('subscribed') != "yes") {
        return TRUE;
   }
   return FALSE;
}

I changed it to where its not reliant on the session like you
suggested:

// returns true if not subscribed
protected function isNotSubscribed() {
   $user = ClassRegistry::init('User')->findById($this->Auth-
>user('id'));
   if ($user['User']['subscribed'] != "yes") {
        return TRUE;
   }
   return FALSE;
}

Thanks again, I appreciate the help.

Andrew


On Jul 10, 11:13 pm, Jeremy Burns | Class Outfit
<[email protected]> wrote:
> Or do $this->Auth->login($user) (where $user is an array containing ('User' 
> => array('username' => 'xxx', 'password' => 'yyy'))) after payment, which 
> will refresh the session.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 11 Jul 2011, at 04:59, Ryan Schmidt wrote:
>
> > Based on what you described, it sounds like when the user logs in, you 
> > store the user object in the session, and that's where you're reading from 
> > whenever you want to see if the user paid. But when the user pays, you're 
> > only updating the user table in the database. One solution would be to read 
> > user information from the database every time you need it, and not get it 
> > from the session (which is stale back to the time the user logged in).
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > [email protected] For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to