Here is proper explanation of Issue that I am facing on Magento 18.104.22.168
I have made custom popups to register and login customer, I have put extended
Mage_Customer_AccountController class from my custom module, and simply register customer and login him after it. not more complex customizations.
But I face one issue, I register and login customer successfully, but after receiving ajax response I refresh browser page, and I found customer is not logged in. I have checked customer status right before
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response)); and I verified customer logged in. but some how browser refresh is not showing customer is logged in.
I tried above code in fresh Magento 22.214.171.124 with sample data and with cache disabled. I face same issue.
I think issue is with session instance. To find out session validation, when I put form_key input in my forms and trying to validate, it fails. key value change in my controller action.
My form html input form_key :
<input name="form_key" type="hidden" value="B6cegiWPPdruA83H">
and I am verifying it using this in controller action method:
Mage::log(Mage::getSingleton('core/session')->getFormKey(), null, "popups.log", true);
I found value is different here:
I tried above method to verify session instance, I am not sure why it changes on for ajax requests.
so I think session is not persistent, I log in customer in session, and when I refresh browser page, May be new session is created and I lost customer login.
registered customer with my custom forms, can login with normal Magento login form.
can somebody please help me with this ? I am sure I am missing something, but not sure about that. I can post controller methods which I use to register and login customer.