• Hi,
    i have problem with the logout function with woocommerce.
    I have installed a fresh theme without any extra plugins. Woocommerce is acivate.
    When i login i can see (left side) some information like “Orders” etc.

    When i click “logout” i can see a “customer logout” link…its asking me if iam sure to logout. When i click YES, the WP-Admin page is loading.

    Now i can see a link “go back to the Main Site”. When i click on the link (to geht back to my page), iam logged IN again. I dont know what to do and i dont know what the problem is.

    Is there ANYBODY who can help me :-/.

    Plugins:
    Woocommerce Version 3.1.0
    Salient Visual Composer Version 5.0.1
    Contact Form 7 Version 4.8 |

    • This topic was modified 7 years, 4 months ago by shinenow.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Experiencing the same problem. User never gets logged out.

    Wordpress 4.8
    Woocommerce 3.1.1
    WPML 3.7.1

    Same problem here.

    I’m having this same issue as well, anyone have a solution?

    nicolaep

    (@nicolaep)

    Hi All,
    Did you manage to find the solution for this one?
    I’m experiencing same issue.
    Thanks
    N

    David

    (@dcrabill)

    I am experiencing the same problem. My site is running on Apache on a Digital Ocean VPS, with SSL managed through Cloudflare.

    kevinhbruce

    (@kevinhbruce)

    still no solution here. My logout issues deal with the classifieds plugin, using WooCommerce’s accounts. Won’t completely logout. I used Chrome devtools to see that the cookie gets destroyed upon logout, but when you go back to the WooCommerce accounts page, the cookie gets regenerated. It must be storing a session data somewhere non-standard to WordPress.

    jeesus

    (@jeesus)

    For me the problem was in some conflicting plugin. So be sure to first check that.

    David

    (@dcrabill)

    I finally figured this out. WooCommerce does some interesting things with login cookies and nonces, which I assume allows them to use WordPress’ user system without giving a basic customer full subscriber access.

    Ultimately I needed to remove this code from wp-config.php:

    define( 'ADMIN_COOKIE_PATH', '/' );
    define( 'COOKIE_DOMAIN', '' );
    define( 'COOKIEPATH', '' );
    define( 'SITECOOKIEPATH', '' );

    I believe I had added that to fix a login redirect loop, which occurred after switching my site to Cloudflare Flexible SSL. I had also added this to wp-config.php to accommodate Flexible SSL, as referenced here and here:

    define( 'FORCE_SSL_ADMIN', true );
    if ( strpos( $_SERVER['HTTP_X_FORWARDED_PROTO'], 'https' ) !== false ) {
    	$_SERVER['HTTPS'] = 'on';
    }

    I eventually found that WooCommerce is not compatible with Cloudflare Flexible SSL, as mentioned at the bottom of their SSL FAQ page.

    I ended up installing a free SSL certificate on my server using Let’s Encrypt, and switched Cloudflare’s setting to “Full (strict)”. Once I had full SSL working, I was able to remove the above lines of code from wp-config.php.

    It’s possible that removing the top four “cookie” lines would have solved the issue and I could have continued using Flexible SSL. However, I had installed the SSL cert before discovering that wp-config.php was the issue. Regardless, setting up the full SSL cert is what I should have done in the first place. As Cloudflare says, “Only choose Flexible if your origin webserver cannot accept secure (HTTPS) connections.”

    David

    (@dcrabill)

    Also, in debugging this issue, I came across the wc_session_use_secure_cookie filter, which is applied when the login cookie gets set and destroyed in class-wc-session-handler.php. My site seems to work fine no matter which way it’s set, but I added it to functions.php for good measure:
    add_filter( 'wc_session_use_secure_cookie', '__return_true' );

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Logout (customer Logout) nor working’ is closed to new replies.