• Resolved pascal93

    (@pascal93)


    Hello,

    we are currently working on B2B-access to our Online Shop for our retailers (WooCommerce). So far, we just accepted orders via our guest-access, so there was no need to register for our customers.

    We are right now in the testing phase. We set up that a session is expired after 60 mins. While testing, we realized that if a session expires, our clients as well are logged out and are directly redirected to the backend-login page (our admin/ developers login). However they should stay in the frontend and should never see or know our URL to our backend login.

    Is there any possibility to redirect logged-in customers to another page?

    Many thanks for your help!

    Best regards
    Pascal

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support vupdraft

    (@vupdraft)

    To automatically redirect users to your WordPress website’s home page after they have logged out, then copy and paste the code below at the end of your WordPress theme functions.php file.

    //redirect users to homepage after logging out

    add_action(‘wp_logout’,’redirect_to_homepage_after_logout’);

    function redirect_to_homepage_after_logout(){
    wp_safe_redirect( home_url() );
    exit;
    }

    Thread Starter pascal93

    (@pascal93)

    Thank you for the code @vupdraft!

    I have pasted the code into the functions.php of our child theme. Unfortunately, it did not work and the customers are still redirected to the backend-login-page. Do you have any idea what could be the problem? Is there any other way to solve this issue?

    edit: Maybe the problem is that the clients do not intentionally “log out”, since it is a session timeout instead.

    • This reply was modified 2 years, 10 months ago by pascal93.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Session Timeout: Clients redirected to backend-login’ is closed to new replies.