Login user programmatically in magento not working properly?
<p>Code which i am using is given below</p>

<pre><code>public function loginUser($email, $password){
   $session = Mage::getSingleton('customer/session');

    try {
        $log = $session-&gt;login($email, $password);
        return $log;
     } 

    catch (Exception $ex) {
        return false;
    }
 }
</code></pre>

<p>it returns 1 but not log in the browser , when i refresh the page it is not going set as a 
login user</p>
