简体   繁体   English

如何检查umbraco中的cookie?

[英]How to check cookie in umbraco?

I want to check cookie in umbraco , is it possible or not ? 我想检查umbraco中的cookie,是否有可能?

If yes then how can i set cookie in template and can retrive cookie's value in template or xslt? 如果是,那么我如何在模板中设置cookie并可以在模板或xslt中检索cookie的值?

You could use the built in Library to do this: 您可以使用内置库来执行此操作:

<xsl:value-of select="umbraco.library:RequestCookies('cookie')" />

Add that to your XSLT and you can call the macro from any pages in your site. 将其添加到您的XSLT,您可以从站点中的任何页面调用宏。

Just to complete the answer you would use 只是为了完成您将使用的答案

<xsl:value-of select="umbraco.library:setCookie('cookie')" /> 

to set the value and the above code to get the value. 设置值和上面的代码来获取值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM