• Resolved kouroshnarian

    (@kouroshnarian)


    hi there,

    I have some issues where my users logged in to my website and close their browsers without logout.
    I have used user menus, wooCommerce, WP Super Cache plugins and some plugins to display menu items and contents based on user login or not.

    So the following items of the main menu are shown when the user does not login yet:

    State A) Home – Sesame Oil – Login

    After logged in, the user sees the following items:

    State B) Home – Sesame Oil – Shop – Hello username – Logout

    But what is the problem:
    1- When the user logs in to his account, if he closes the browser and reopens it, he will encounter the menu before the login. While he should see the menu that he saw in the login mode. In fact, I feel that there are interference and Conflict between the cache and the cookie.

    2- In this case, if the user has already selected a number of goods for purchase but has not check-out, the Cart plugin also shows this number of goods. That means the WooCommerce cookie works well.

    3- This problem occurs when we close the entire browser. If we just close the Tab where my website is running and open a new Tab and browse again the website, this will not be any problem. Even if a separate window from the browser is open (and displays any website other than my website), we still won’t have this problem.

    4- There is another interesting point. If our browser is Opera, we won’t have this problem again. But we have this problem on Google Chrome, Firefox and Internet explorer.

    My website address: https://addroot.com/mysite_eng
    Please tell me how to send the Administrator username and password if it’s needed.

    Please help. I have been working on this for more than 10 days. I’ve read a lot of articles about cache and cookies and I’ve done a lot of experiments, but I haven’t come to any conclusions.
    I am also satisfied that if the user closes the browser, the logout automatically from his account.

    Best regards,

    Kourosh

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    @kouroshnarian – Sorry we missed this one. That said we don’t set cookies, login cookies are controlled by WordPress, we simply show different content based on that status, so I’m not sure the issue your describing is related to our plugin at all, rather our plugin is simply part of the symptoms.

    That said a few things as it wasn’t 100% from your description.

    Are you saying after closing and reopening the logged in user is still logged in, or now logged out?

    If they are still logged in that is likely to be expected in all the browsers you mentioned as they have “Reopen last tabs” set as the default. This is known as session saving and of course persists session cookies across closing/reopening.

    Otherwise you would need to exclude the wp_logged_in_* cookies from your cache as those are the ones used by WP to detect logged in users, the same our plugin depends on.

    Hopefully you already worked that out but wanted to leave this here in case it is still is helpful.

Viewing 1 replies (of 1 total)
  • The topic ‘Menu item troubles when close and reopen the browser’ is closed to new replies.