Thread Starter
shua
(@shua)
Here is another example of my use of cookies.
When a user fills in a form I set a cookie for each field.
When the user navigates to a different form on the site, the fields are pre-populated.
In wp2.5 the cookie is deleted or lost or destroyed – it is gone.
Please help.
Thread Starter
shua
(@shua)
I went ahead and created a fresh install of wp2.5.1 with a brand new db. I created some pages and posts and added a bit of cookie code.
When navigating to a page with the id of 2 I do this in the header.php
<?php if(is_page('2')){
setcookie("myName", 'shua', time()+36000);
} ?>
pretty straight forward stuff.
I then see if the cookie was set using the ‘Cookies’ menu item in FF WebDeveloper extension. Low and behold… it is there.
I them navigate away from that page, to a page with id 3. I once again look at my cookies… gone.
What is going on???
Cookies are turned on, they are set to expire in 10 hours – and cookies from other sites persist?!?
I have the same trouble. When I open a new window using javascript window.open(‘http://mysite/myfile.php’), the session is lost.
In myfile.php, is_user_logged_in() return false
Amazingly the same code works in localhost
please help
Thread Starter
shua
(@shua)
you must NOW set the domain for the cookie for it to not be destroyed – a big undocumented change from prior 2.x versions.