• I display conditional content if a user has a specific cookie set.

    My code has been working for the past year +, but not after an upgrade to 2.5.1.

    It looks as if the cookie is set – but when navigating to another page it is destroyed.

    thoughts???

    Does wp2.5 destroy session cookies? domain cookies etc?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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?!?

    Thread Starter shua

    (@shua)

    Any thoughts?

    I have the same trouble. When I open a new window using javascript window.open(‘https://mysite/myfile.php&#8217;), 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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp2.5 deleting cookies’ is closed to new replies.