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.

rgrdz
Boris

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

rgrdz
Boris
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


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates