0

I'm running WordPress Network on Nginx Web Server and I'm facing some issues when any user tries to login. If the user tries to login without any of website earlier login data (cache and cookies), they'll authenticate successfully for some time or temporarily.

enter image description here

But if the browser restarts or they follow any link within the page, their session is lost. In my case I tried to access user-settings page and got kicked out of the session.

enter image description here

enter image description here

The status code returned in network tools from Mozilla Firefox enter image description here

That what happens if I try to login again without clearing the site's cookies and cache on current browser.

I can login in the network administration page without any issue. enter image description here

I think there's something that terminates users session abruptly. And may be the root of login issues in my site. Please, help.

6
  • That's after they've logged in and the page has reloaded? As far as I know WordPress doesn't generate alerts like that. Can you look at your browser debug tools to see what request your site makes before that pop-up appears? Hopefully you'll see a REST API endpoint there that's throwing the error that you can investigate. But I think this is something one of your plugins or your theme is doing, not WordPress core.
    – Rup
    Nov 14, 2021 at 10:16
  • I'd guess though it's some code that assumes the session that's expired hasn't, so you may eventually have to track down whatever's breaking the session. But this code ought to handle that more gracefully too, if you can work out what exactly is going wrong.
    – Rup
    Nov 14, 2021 at 10:54
  • Indeed, it's plugin issue and not related to WordPress core like I thought earlier.
    – AtomX
    Nov 14, 2021 at 15:18
  • 1
    Is there any useful messages in the 400 response? Can you see the request that it's making, specifically the action parameter? (either on the Request tab or at the bottom of the Headers tab) And can you work out which plugin is registering that action? I'd also check for anything in the server logs just in case, but I'd guess there won't be.
    – Rup
    Nov 22, 2021 at 23:37
  • 1
    The next step might be to add debug trace to the handler function for that action. However it could be that that action is only hooked for logged in users anyway, and you've already lost the session by that point and the 400 is because you're already unauthenticated. So it might not actually tell us anything anyway. But it's worth looking at any messages you have here, and finding the action so you can verify that: that it's hooked with just wp_ajax_<action> and not also wp_ajax_nopriv_<action> too.
    – Rup
    Nov 22, 2021 at 23:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.