Setting custom cookies in WordPress

Question

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:

  1. 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?
  2. 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.
0
Atticus 2 months 0 Answers 12 views 0

Leave an answer