Can i set/read cookies with Smarty
Posted: Fri Sep 23, 2022 1:40 pm
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?
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?