0
  • I am using WordPress as a solution for digital signage on large displays and on personal computers in a company.
    • In this use case the WordPress installation is a closed system which needs a login to show the content.
    • There are user roles, depending on your position in the company, and a few administrators who take care of the content.

Normal users don´t need/have access to the backend, administrators of course have. So I developed two functions (ok, one was finished already) to a) redirect users to the front page after login and b) disable access to the backend. You can find the source code of the functions here.

Since the upgrade to 4.2 users get logged out all the time and they can´t reach the frontend anymore. It´s like they get logged out directly when they hit the front page and are then, of course, redirected to the login form, because you need to be logged in to view the page.

The check if you are logged in is done via this code:

// nologin is a special page => no login required for displays at the walls
if(!is_page('nologin')){
   // is the current user already logged in?
   if(is_user_logged_in() == false) {
      // if not, redirect to login form
      wp_redirect(home_url( '/wp-login.php' ));
      exit();
   }
}

As far as I can see 4.2 did not change anything I deal with here. Nevertheless while I can not reproduce the logout problem with Chrome, I can do so with Firefox and the latest Internet Explorer which leaves me kind of without a plan regarding what to look for.

Any ideas on this topic? I already had a look at Login Trouble but that did not help with my problem.

Thanks!

  • Delete all your cookies from your browsers cache. Maybe previous cookies are overriding the new ones. – user42826 Apr 28 '15 at 20:34
  • I tried that and it did not help. – flomei Apr 29 '15 at 6:10
  • But on the other hand, the auth cookies might be the problem to look for. Not sure. I will try to dig deeper into it. – flomei Apr 29 '15 at 6:21
  • 1
    Can admins login in ok? I would try narrowing down which code is having problems. Your users might not be getting logged out, your code just might not be recognizing that they are logged in. – user42826 Apr 29 '15 at 6:52
  • Admins can log in (and are redirected to the Dashboard) but can´t visit the frontend either. They are then redirected to the wp-login.php but are still logged in into the backend. So it´s "just" some redirect failing. – flomei Apr 29 '15 at 11:13

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.