title: How to get user info every time user access the pages of the site in zend?
body: <p>I am new to Zend</p>
  
  <p>I searched it and got the following link,
  <a href="https://stackoverflow.com/questions/5849845/how-to-keep-track-of-currently-logged-user-in-zend-framwork">how to keep track of currently logged user in zend framework</a>.</p>
  
  <p>But my requirement is different.</p>
  
  <p>My situation is, I am having seperate controller called AuthenticationController to store the logged user details in session using Zend_Auth and doing other stuff,Now i have to get the logged user info, when every time logged in user access every page of the site.</p>
  
  <p>so i have to do some logic in common file that fires every time to get user info in zend.</p>
  
  <p>How can i do that in zend ?</p>
  
  <p>Following is sample piece of code ..</p>
  
  <pre><code>if ($form-&gt;isValid($request-&gt;getPost())) {
      if ($this-&gt;_process($form-&gt;getValues())) {
          $authentication = Zend_Auth::getInstance();
  
          if ($authentication -&gt;getIdentity()-&gt;myfirstlogin == 0) {
  
              $this-&gt;_helper-&gt;redirector('index', 'test1');
  
          } else {
  
              $this-&gt;_helper-&gt;redirector('index', 'test2');
  
          }
      } else {
          $myUserStatus = new Zend_Session_Namespace('myuserStatus');
          if ($myUserStatus -&gt;status == 2) {
              $this-&gt;_helper-&gt;FlashMessenger('Incorrect Username / Password');
          } else if ($myUserStatus -&gt;delete == 1) {
              $this-&gt;_helper-&gt;FlashMessenger('Your **** approval.');
          } else {
              $this-&gt;_helper-&gt;FlashMessenger('Please ****** administrator');
          }
  
          unset($myUserStatus);
          $this-&gt;_helper-&gt;redirector('index', 'auth');
      }
   }
  </code></pre>
  
  <p>.......</p>