How to check cookie in umbraco?

I want to check cookie in umbraco, is it possible or not?

If so, how can I set a cookie in a template and output the cookie value to the template or xslt?

+6
source share
1 answer

You can use the built-in library for this:

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

Add this to your XSLT and you can invoke the macro on any pages of your site.

To complete the answer you should use

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

to set the value and the above code to get the value.

+5
source

Source: https://habr.com/ru/post/921102/


All Articles