Can someone please explain why ?___SID=U is appearing in some Magento URLs on my site and not others?
I think it has something to do with sessions but I am not entirely clear. Also, what makes it more confusing is the fact that it’s only appearing in some URLs and not others.
I don’t need to know how to remove it as I am aware of the setting in the admin area. I would really like an explanation of what it is, what its purpose is and why it would show on some pages and not others. id rather understand what’s going on fully than blindly follow some advice as to how to remove it.
I addition to Brendan’s answer, the
___SID=Uis used in the cache as a placeholder for the session ID. It is replaced byMage_Core_Model_Url::sessionUrlVar()which in turn callsMage_Core_Model_Url::sessionVarCallback(). These methods are called fromMage_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:
If the string still displays in the rendered page that is a bug. Are you using some custom caching module, or generating URL’s using a non-standard way?