When users visit a page on my site, I've written code to set a value:
if(window.location.href.indexOf("promotionpage") > -1) {
Cookies.set('landingpage', 'kent', { expires: 30, path: '/promotionpage' });
}
This is working great and the cookie is being set. Depending on if the above cookie is set, I want to then add a module position to the index.php page, I've written the following to read if the cookie is set and then include a module position, but it's not working:
<?php
if(isset($_COOKIE['kent'])){ ?>
<jdoc:include type="modules" name="kentModal" style="none" />
<?php } ?>