Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Easiest way to access cookie in templates?

Quote Reply
Easiest way to access cookie in templates?
Hello,

I'm trying to play with some javascript combined with some template code and when I set the cookie from JS the next time user visit my page I'm trying to check the cookie from there but ... no luck so far Pirate

Can anyone pint me to the right direction?
I have tried <%in.cookies%> <%in.cookies.cookiename%> <%in.cookiename%> but all with no luck. Frown

But when I do template dump the cookies are in place.

What I'm doing wrong? Or I can't access cookies that way.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins

Last edited by:

eupos: Jan 30, 2008, 5:11 AM
Quote Reply
Re: [eupos] Easiest way to access cookie in templates? In reply to
Oops never mind I've found it Blush

Sorry.

p.s. The answer is here: http://www.gossamer-threads.com/...orum.cgi?post=298544

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Easiest way to access cookie in templates? In reply to
Hi,

Yup, or via ULTRAGlobals (may as well keep with your way now, but just in case anyone wants to know =))

Code:
<%set cookie_val = Plugins::ULTRAGlobals::Load_Cookie('COOKIE_NAME')%>
<%if cookie_val%>
Value of cookie COOKIE_NAME is <%cookie_val%>
<%endif%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!