title: Return JSON data in admin Magento
body: <p>Good afternoon,</p>
  
  <p>I'm trying to create AJAX login inside Magento admin. But I don't know what's going with Magento login function and login action. I'm quite new to Magento and really confused with it...</p>
  
  <p>I already knew there are two place to handle login.</p>
  
  <p><code>/core/Mage/Admin/Model/Session.php</code> (login function)</p>
  
  <p>and</p>
  
  <p><code>/core/Mage/Adminhtml/controllers/IndexController.php</code> (login action)</p>
  
  <p>What I have to do to return JSON data? And the <strong>Url</strong> (<code>index.php/admin/login</code> ?) to handle it?</p>
  
  <p>To clear, there are two question I need answer to solve it myself.</p>
  
  <ol>
  <li>What is login() function? How it works?</li>
  <li>What is loginAction() function? How it works?</li>
  </ol>
  
  <p>Any help will be appreciated. Thanks everyone!</p>