The Cookietool Velocity Viewtool allows you to create and access cookies. This class is only designed for use as a request-scope tool.
The following example shows how the CookieTool Viewtool is mapped in the toolbox.xml file:
<tool>
<key>cookietool</key>
<scope>request</scope>
<class>org.apache.velocity.tools.view.tools.CookieTool</class>
</tool>
Example
How to return a cookie value and how to set a cookie label/value.
//get a cookie value
$cookie.foo
//add a cookie label and value
$cookie.add("bar",'woogie')