In Firefox (IE, Chrome, and Safari are fine), we are having a problem with is_user_logged_in().

What happens is: a member logs in and is then automatically redirected back to the portal page. This page does not recognize they are logged in (we use is_user_logged_in()) until they refresh the page. Then all is fine after that.

Any ideas?

Here is a small piece of the code which changes the log in/out button based on is_user_logged_in(). Upon log in and redirect, is_user_logged_in() is false until the page is refreshed in browser (Firefox only):

<div class="one-half last">

<?php if( is_user_logged_in() ) : ?>

<a class="button full-width" href="<?php echo wp_logout_url( home_url() ); ?>" target="_self">

<?php else: ?>

<a class="button full-width" href="<?php echo wp_login_url( get_permalink() ); ?>" target="_self">
    Ouvrir mon portail

<?php endif; ?>


Sorry I'm unable to share the site as it's a private members portal.

  • 2
    do the domains of the login page / redirect page / refreshed page all match exactly? have you tried inspecting cookies to see if the authentication cookie exists on the page where is_user_logged_in doesn't work? – Milo May 13 '14 at 5:29
  • Also, do you have caching installed on the site? – Steven Jones May 13 '14 at 15:47
  • All domains match exactly. There is no cookie in Firefox only until you refresh the page. All other browsers are fine and work properly, even IE (imagine that). – julie-lunarwp May 14 '14 at 18:10
  • @StevenJones No there is no caching on the site currently. – julie-lunarwp May 14 '14 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.