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:
- 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.
0
2 months
0 Answers
12 views
0
Leave an answer
You must login or register to add a new answer .