I know that a should set a cookie before any output.
I want to set a cookie with the actual page's taxonomy name.
To get the taxonomy name I am using get_query_var('taxonomy)
.
The problem is:
If I hook the cookie creation into init
the get_query_var
returns empty. If I hook it too late I get a headers already sent
error.
How can I accomplish this?