1.2releasedCookie Monster
Easily create and remove cookies by appending values to URLs
Clone URLhttps://github.com/symphonists/cookiemonster.git
Add as a submodulegit submodule add https://github.com/symphonists/cookiemonster.git extensions/cookiemonster --recursive
Compatibility
2.x.x | 2.1.x | 2.2.x | 2.3.x | 2.4.x | 2.5.x | 2.6.x | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.7.4 | 2.7.5 | 2.7.6 | 2.7.7 | 2.7.8 | 2.7.9 | 2.7.10 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
No | No | No | 1.2 | No | No | No | No | No | No | No | No | No | No | No | No | No | No. Soon? |
Readme
Cookie Monster
Installation
- Upload this folder,
cookiemonster
, to your extensions folder - Navigate to System > Extensions and enable it
- Add the "Cookie Monster: Add GET variable to cookie" event to your page
Usage
After attaching the event to a page, request it with a URL such as:
/my-page/?colour=red&shape=square
This will store these two values into the Cookie Monster cookie. To unset cookie values, send an empty string:
/my-page/?shape=
Remember that cookie changes won't take effect until the next page load, thus new parameters will not show up in the datasource (or page params) right away, however they will be present in the Event XML to signify the change.
Values added to the cookie via cookie monster will show in the page params like so:
$cookiemonster-colour = red
$cookiemonster-shape = square
And in the page XML as:
<data>
<params>
...
<cookiemonster-colour>red</cookiemonster-colour>
<cookiemonster-shape>square</cookiemonster-shape>
</params>
...
</data>
Version history
Requires Symphony 2.3
- Removed data source, all data available in param XML
- General tidying up, updated for Symphony 2.3
Works up to Symphony 2.2.x
Requires Symphony 2.0.6