• Hey all, so I tried to make a simple LMS system by inserting different quizzes on different pages, the user can click on the button at the result page of one quiz and then go to next quiz.

    I noticed that when the user entered certain quiz pages, they suddenly got logged out, but when they clicked on some other links on that page, they were still logged-in. This is a really disaster, because the progress of the quiz can only be viewed by the logged-in user.

    I have tried many ways to solve this, but still have no clue. If anyone has any idea, plz definitely let me know.

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

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    If this is a random, intermittent problem, it’s likely due to the browser failing to send the expected auth cookie with the request, or it being dropped en route. Without an auth cookie, WP assumes the user is logged out. If another request does send the cookie and it’s still valid, WP treats the request as a logged in user regardless of what happened before.

    If the user never intentionally logged out, I fail to see how them being treated as logged in again is a “disaster”. It’s as though the erroneous log out never happened, so how is that a problem?

    Even if it’s not that big a deal, it’s still wrong and shouldn’t happen. If you can reliably replicate the problem, then perhaps the source can be found. Intermittent problems are very difficult or impossible to debug, especially if the root cause is external to WP.

Viewing 1 replies (of 1 total)
  • The topic ‘Users get logged out after clicking on some pages’ is closed to new replies.