Try writing an operator, if all you want to do is read a cookie then you can write an operator to get the cookie and pass the result to the front end template. Take a look at eZRSS as an examples or read http://ez.no/developer/ez_publish_3/documentation/development/kernel/custom_template_operators
Tony
Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development