Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check cookie in umbraco?

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

If yes then how can i set cookie in template and can retrive cookie's value in template or xslt?

like image 872
Lajja Thaker Avatar asked Jul 23 '12 06:07

Lajja Thaker


1 Answers

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.

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.

like image 174
SimonAntony Avatar answered Oct 13 '22 10:10

SimonAntony