Hi
I need to be able to set cookies and check for the existence of the cookie - simply to disable a pop-up box from a page if the visitor has been there before. Can I do this with Smarty from within my page template? If not ... how do I use php within a page? Basically I need this process....
1. A certain page on my site sets a cookie
2. Another page on my site checks for existence of cookie and outputs HTML depending on whether cookie exists, so this process
check for cookie
if cookie exists, display this html
<xxxxxx>
If cookie doesn't exist, display this html
<yyyyy>
Can anyone point me in the right direction?
Can i set/read cookies with Smarty
-
- Forum Members
- Posts: 192
- Joined: Mon Nov 26, 2018 3:09 pm
Re: Can i set/read cookies with Smarty
Try this tutorial: https://cmscanbesimple.org/blog/set-rea ... ug-cookies
You might also want to look at the jquery cookie method linked at the top of the article (for EU consent, but easily adapted) as another option.
You might also want to look at the jquery cookie method linked at the top of the article (for EU consent, but easily adapted) as another option.
Not getting the answer you need? CMSMS support options
-
- Forum Members
- Posts: 192
- Joined: Mon Nov 26, 2018 3:09 pm
Re: Can i set/read cookies with Smarty
Thanks for this - looks useful, will check it out