Right way to check secured HTTPS mode being used in Magento code

When you work with Ajax, this problem become important and you need to get it right way. Otherwise your Ajax request wont work on secure mode. So here here is how you will solve this problem in your custom code in correct Magento programming practice

if (Mage::app()->getStore()->isCurrentlySecure()) { //secure mode your current URL is HTTPS

} else { //your page is in HTTP mode

}?>

This tip will be helpful when you have to deal with displaying images,….too.

Comments

Leave a Reply

Your email address will not be published.

4 × four =

Security Code: