Magento:?___ SID = U出现在某些网址中 [英] Magento: ?___SID=U appearing in some urls

查看:103
本文介绍了Magento:?___ SID = U出现在某些网址中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释为什么吗?___ SID = U出现在我网站上的某些Magento URL中,而不是其他人吗?

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.

推荐答案

除了Brendan的回答外,___SID=U在缓存中用作会话ID的占位符.它由Mage_Core_Model_Url::sessionUrlVar()替换,而Mage_Core_Model_Url::sessionUrlVar()依次调用Mage_Core_Model_Url::sessionVarCallback().这些方法从的,这意味着任何URL在块输出发现将包含正确的会话ID(如果需要的话)被调用.

I addition to Brendan's answer, the ___SID=U is used in the cache as a placeholder for the session ID. 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

如果在呈现的页面是一个错误的字符串仍然显示.您是否使用了一些自定义缓存模块,或生成的URL使用非标准的方式?

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?

这篇关于Magento:?___ SID = U出现在某些网址中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆