Search code examples
javascriptjqueryexpressionengine

Create cookie if link clicked, redirects to clicked link on next visit


Site has two sections; 'Everywhere' and 'LA'.
Default is 'Everywhere' section.

How would I go about creating a cookie if the visitor clicks the 'LA' section link and when they return to the main site on another visit, they are redirected to that 'LA' section?

I've tried altering this script; http://www.javascriptsource.com/cookies/cookie-redirect.html

Instead of checkboxes, its a link and only one. But doesn't seem to work.


Solution

  • What I do usually is create a conditional, and create an embed with the cookie inside. I also tend to use this add-on: http://devot-ee.com/add-ons/cookies