• Resolved vladduma

    (@vladduma)


    Recently I have noticed a weird problem with My Account:

    When I try to log in as a user (not admin) I get to My Account page, but as soon as I leave My Account page and try to go back it sends me to login page. So a user does not stay logged in…

    If I am logged in as admin everything works fine.

    Did not have this problem earlier. Reverting recent changes I made to the website did not help.

    Any ideas why is it happening and how to fix it?

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    This is usually a WordPress level question – this article is a great place to get started:
    https://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-keeps-logging-out-problem/

    Thread Starter vladduma

    (@vladduma)

    Thanks for your reply, @fernashes

    But I do not think it is an issue. I checked the settings and modified wp-config file, but the problem is still there.

    I really think there is something with my wordpress/woocommerce/login template/etc. Few more details and observations:
    1. Sometimes I have to press ‘login’ button twice to get to my account. After first time page reloads and nothing changes, second time – brings me to ‘My account’. But,
    2. When I try to switch from admin account to a user account it can take me to the one I used before instead of the one I try to login now…
    3. Also, if I change Woocommerce account page settings, I check all boxes in ‘account creation’ (generates log and pass) the registration form is not changed immediately, but after I press login button and the page refreshes, then I see new registration form (email field only).

    All of this issues show up occasionally, but only one one persists: if I log in as a user and leave my account page – i have to log in again… Any other I ideas how to fix this?

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Thanks for the added info!

    I’d started with ruling out a conflict with your theme/plugins – that’ll at least rule out some different variables.

    The best way to determine if the issue is being caused by a theme and/or plugin is to temporarily switch your theme to Twenty Seventeen and disable all plugins except for WooCommerce. If you can install plugins, install Health Check. On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you while you’re logged in to that session without affecting normal visitors to your site.

    If that resolves the issue, then slowly re-enable features until you find the one that’s causing the conflict.

    It sounds like you might be doing a lot of testing to get to the bottom of the problem, so a staging site would be a good idea. I prefer WP Staging for quickly spinning up a new test site.

    Please let me know how it goes!

    Thread Starter vladduma

    (@vladduma)

    Ooook…. so this was a weird one

    According to your advice I turned off all plugins and switched to a stock theme, cleared cache and tried to log in – success, everything worked as expected.

    Then, I switched back to my (child) theme and every thing was fine as well! I almost started celebrating, but checked once again – broken.

    Repeated the cycle. same thing. This hinted me that the problem is somewhere in my child theme.

    Turned out that while creating a child theme, I copied all files offered by Child Theme Configurator (because I do not know which files were modified by developer, so copied all available). This created one file in child-theme/woocommerce/my-account folder. So i think, this one file created some kind of a loop and was triggering two templates at once (or one after another)…

    Solution
    Deleted /my-account folder from the child theme and everything is back to normal.

    • This reply was modified 7 years, 1 month ago by vladduma.
    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    I’m glad to hear you found the solution and thank you for sharing your steps! Weird template overrides could definitely cause a problem like this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cannot stay logged in to My Account as a user’ is closed to new replies.