Support » Fixing WordPress » is_user_logged_in() incompatible with firefox and chrome?

  • Resolved stant0n


    Under Internet Explorer 8, everything works as expected.
    Under Firefox 3.6.6 and Chrome 4.1 any time a link is clicked on the site (and the link isn’t listed on a menu or sidebar) the is_user_logged_in() function always returns false.

    Here’s what I’m doing. On I’ve created a custom header menu that will direct logged in users to a different product page than those not logged in.
    This product page contains links to other products.
    If you click on one of these links using Firefox or Chrome, the Logout button switches to a Login button and the custom menu directs to the wrong page.

    I’ve been troubleshooting this for a couple hours and can’t figure this out. If I add one of the product pages to the sidebar or header menu’s the behavior is resolved. However I can’t have the menus cluttered with every product page.

    Any ideas?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Basically is_user_logged_in() will check the authentication cookie that has been set when the user is logged in. After login, this cookie should remain intact within cookie store of the browser and it is sent back on each subsequent request. I suggest you use a debugging tool like Fiddler to see why the authentication cookie is no longer there.

    I registered on the site just to see. Using Firefox 3.6.8. At the moment I seem to stay logged in even after restarting the browser. The only cookie problem I could see was that was trying to set a cookie with an invalid date.. but that’s their problem. Or it might be because I have 3rd party cookies disabled at the moment.

    Hey guys,
    I’ll look into the cookies but I don’t think thats the problem. Because like you said Mark, you don’t actually get logged out. The function just reports false, incorrectly.

    If you login to the site, go to the “Meditations” page and then try to browse the CD’s at the bottom, you’ll see the function fail as the “Logout” button will change to “Login”. But as soon as you use any of the links on the menu, the function begins working properly and you’ll see that you’re still logged in.

    Figured out the problem. The cookies are being set with a domain when logging in; however, the CD pages below are going to instead so the cookie does not match. Need to make sure all the links in your blog go to either or and not a mixture of both.

    Hope that helps,
    Mark H.

    Ah! Thanks so much Mark.
    I changed the blog to and the issue appears to be resolved.

    Odd that IE could work around this though.

    Thanks again!

    MarkRH, would this

    The cookies are being set with a domain when logging in; however, the CD pages below are going to instead so the cookie does not match.

    explain the problem I’m having here:

    And if so how can make this work (i.e. adduress URL domain & site URL domain are different) so I can tell if someone is logged in and get their user info?

    Thanks for any help.

    Good day,

    I found the solution to this. There is some issue with the settings of the site URL domain and wordpress site.

    [referral link redacted] It works for me. I also face the same problem and found some way to solve it. Hope it works for you too. Let me know too if you found a better way.


    Founder of [signature moderated]

    jfe63, not sure your link is supposed to go, but doesn’t seem to have a solution to the issue.

    Nevertheless I found a solution and posted detailed explanations in the thread I had started about this issue (mentioned above also):

    Hope this helps.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘is_user_logged_in() incompatible with firefox and chrome?’ is closed to new replies.