hi,

i'm making an application in which the user have to logon in order to get
access to the real 'goodies'.

in my authentication action in my index controller i'm doing this when the
user is verified:

      $sesuser = new Zend_Session_Namespace('user');
      Zend_registry::set('user', $user);
      return true;

which means that i store the user info in the registry.

in my welcome page i use this in order to show the username to the user when
logged in:

echo Zend_registry::get('user')->username

and it works. i see the correct username dispayed.

when the user click the forward link he's redirected to another controller:

GameController

in the init of this i do:

      $registry = Zend_Registry::getInstance();
 //     print_r($registry);
      try{
        echo Zend_registry::get('user')->username;
      }
      catch (Exception $e){
         echo "YOU'RE NOT LOGGED IN ".$e;
         $this->_redirect('/');
      }


but no matter what i do, it fails. I would expect the 'user' object to exist
in the registry at this point since i've already accssed it in my welcome
page like this.

but it fails.

if i use print_r($registry) in my welcome page i can se the user object it
contains. but if i write out the registry in my GameController init()
function it seems to have disappeared.

what am i doing wrong?

looking forward to any help.

thanks.

kim
-- 
View this message in context: 
http://www.nabble.com/registry-question-tp24166278p24166278.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to