we have many stores in our site but except main default site, i disabled every store.

but these kind of urls ? = > at the end = "?___SID=U"



please help me to remove those kind of urls

thanks in advance


I just copy what i could find when googling the answer

The SID is a "session ID". Magento uses this to track a user's activity within the same Magento installation. Normally, Magento powers one website and one store from one installation (database). Magento could power multiple websites with multiple stores from one installation though. The SID allows users to stay logged in while navigating across these websites/stores. If you're not running a multi-website or multi-store environment, it's safe to disable the SID on the frontend.

It is replaced by Mage_Core_Model_Url::sessionUrlVar() which in turn calls Mage_Core_Model_Url::sessionVarCallback(). These methods are called from Mage_Core_Block_Abstract::_afterCacheUrl(), which means that any URL found in block output will contain the correct session ID (if needed).

So to get rid of the parameter in your own code the "right way" use this:

$url = Mage::getUrl('some/magento/route'); // might append ___SID parameter
$url = Mage::getModel('core/url')->sessionUrlVar($url); // process ___SID

This is located in the app/code/core/Mage/Core/Model directory

| improve this answer | |
  • hi, thanks a lot that you spent so much time for my needs. can you please tell me in which file , i have to delete which code? that will help me a lot. thanks in advance. – Baby in Magento Feb 19 '15 at 10:17
  • 1
    Located in /Core/Model/Url.php – Klettseb Feb 19 '15 at 10:20
  • is i have to create model folder and create url.php file in core or may i create under app/local/model/url.php ? also, i have to create a new file = url.php, i dont think url.php file is exists in default magento ? – Baby in Magento Feb 19 '15 at 10:35
  • 1
    app/code/core/Mage/Core/Model directory – Klettseb Feb 19 '15 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.