Wordpress: after redirection cookies disappear

Asked

Viewed 18 times

0

I did a simple redirect with

wp_redirect(home_url());
exit();

And after that the cookies are cleared (Session too), which could not happen, how to persist cookies after redirection? From what I saw it seems to be the problem Exit() but without it the direction does not happen.

Thank you.

1 answer

0


The problem was that I had pages that were as localhost, and others with local ip, so these exchanges were identified as different domains and cleared the variables of cookies and session. I standardized the urls to use all the same ip ("domain") and the variables persisted when browsing the pages.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.