Setting custom cookies in WordPress
I am trying to set cookies to re-route returning users to my a specific page within my WordPress site.
I’d like some advice with these 2 things:
- Where in the WordPress php files should cookies be checked before loading any content to handle a redirect? Is there a good file this should exist in over others?
- How do I properly set a cookie within WordPress?
setcookie('cookie_name', 'cookie_value', time()+4000);doesn’t seem to be saving any cookies to my system.