Want a Cookie? Nom Nom Nom.

EE Cookies

This plugin sets and retrieves cookie values with a tag rather than php scripting.

Installation

  1. EE 2: Add the folder /cookies/ to your ./system/expressionengine/third_party/ folder.
  2. EE 1.6: Add the file pi.cookies.php to your ./system/plugins/ folder.

Tags

{exp:cookie:store}
The cookie setter tag. Use it in combination with the parameters below to set and modify cookies. It require all three of the parameters below to be set.
{exp:cookie:retrieve}
This is the getter tag, it can retreave the value of a cookie. It's always used in combination with the name parameter.

Parameters

name=" "
Set the name of the cookie name="cookie_name"
value=" "
The value of the cookie being set value="the value to set"
seconds=" "
How many seconds would you like the cookie to last for? seconds="3600"

Examples

The following sets a cookie named mycookie with the value "EE rules!". The cookie will last for 1 hour (3600 seconds). Set the seconds to zero to set a cookie that does not expire.

{exp:cookie:store name="mycookie" value="EE rules!" seconds = "3600"}

To retrieve a cookie:

{exp:cookie:retrieve name="mycookie"}

This 1.6.x version of this plug in was originally developed by Eric Snyder