Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact
You are here: Home

BracketNights

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • September 17, 2026 at 3:51 am in reply to: Issues after re-signing in #32324
    BracketNights
    Participant

    Thank you once again for your help. I have finally managed to solve it using your advice on what to look for and log. I’ll summarise it below for anyone else who might have the same issue, then I’ll resolve the topic.

    Problem 1: The logout button did not work. Users would remain logged in.
    Solution 1: Removed an errant wp_set_current_user(0) from the plugin code, which I probably put there during my trying to solve problem 2.

    Problem 2: The user’s data (custom code) was still showing and updatable after logout.
    Solution 2: Needed to identify whether is_user_logged_in() or is_member_logged_in() gives me the data I require to be displayed.

    Problem 3: Ajax code was returning a logged-out nonce after login, returning a -1 403 error.
    Solution 2: It was a caching issue, despite me having no caching software that I could find. Every indication was that my website’s Cache-Control was no-cache, but I had to enforce this anyway with the function.php headers and add an expired expiry date. This, coupled with a deferred strategy and null version number when enqueuing the js file that calls the ajax, seems to have solved the problem.

    Thanks again. Bracketnights will hopefully be up and running soon.

    September 14, 2026 at 5:18 am in reply to: Issues after re-signing in #32319
    BracketNights
    Participant

    Well, I found one thing and it fixed one of the problems, but I’m still having a problem with the -1 nonce/cache issue…

    The members are only logging in and out using the Simple Membership forms – no other plugin or custom code.

    I looked further and I still can’t find a caching plugin on WP nor on my host. No Redis or Memcached from what I can find (my webhost service is pretty poor at providing information though).
    I also tried this in different browsers, private mode, and with hard refreshes, all finding the same result, so I really don’t think it’s a browser issue.

    There were no wp_signon() or wp_set_auth_cookie(), but I did find an errant line of wp_set_current_user(0) which I deleted. After deletion, the login and logout seems to work correctly.

    The only remaining issue is that my custom code which requires a nonce works perfectly when not logged in, but often (not always) returns a -1 error when logged in for a short time. If I wait a while, it’ll work normally. Therefore, it has to be a nonce issue with logging in, right?
    Below are my Auth logs and my actions (in case that part is useful too).

    (Note: ‘archive’ here is not the normal archive page, it’s a custom page with php, js, and a wp-nonce)
    1118 Arrive to website, logged out, decline cookies.
    1118 Archive – working, with logged out details.
    1118 Logged in successfully.
    1118 Archive – not working, has -1 error. Console reads: “wp-admin/admin-ajax.php:1 Failed to load resource: the server responded with a status of 403 ()”.
    1119 Homepage shows logged in details correctly.
    1120 Logged out successfully, homepage shows logged out details correctly.
    1120 Archive – working, with logged out details.
    1121 Update meta whilst logged out (should not update logged in meta).
    1122 Logged in successfully.
    1122 Archive – working, with logged in details.
    1123 Logged out successfully.
    1123 Archive – working, with logged out details.
    1123 Logged in successfully.
    1123 Archive – not working, has -1 error.
    1134 Archive – working, with logged in details.

    [2026/09/12 11:18:42] – SUCCESS: Authentication request – Username: teacherpierce
    [2026/09/12 11:18:42] – SUCCESS: SwpmAuth::set_cookie() – Value of ‘remember me’ parameter:
    [2026/09/12 11:18:42] – SUCCESS: The ‘Remember me’ option is unchecked for this request, setting expiry to be a session cookie. The session cookie will expire when the browser is closed.
    [2026/09/12 11:18:42] – SUCCESS: Authentication successful for username: teacherpierce. Triggering swpm_after_login_authentication action hook.
    [2026/09/12 11:18:42] – SUCCESS: Trying wp_signon() with username: teacherpierce
    [2026/09/12 11:18:42] – SUCCESS: wp_authenticate action. Handling login for username: teacherpierce
    [2026/09/12 11:18:42] – SUCCESS: SwpmAuth::login()
    [2026/09/12 11:18:42] – SUCCESS: wp_login hook triggered. Username: teacherPierce
    [2026/09/12 11:18:42] – SUCCESS: Setting current WP user to: teacherPierce
    [2026/09/12 11:18:42] – SUCCESS: Triggering swpm_login_auth_completed_filter hook.
    [2026/09/12 11:18:42] – SUCCESS: Triggering swpm_after_login hook.
    [2026/09/12 11:18:42] – SUCCESS: After triggering the default swpm_after_login_redirect_url hook. Redirect URL: https://www.bracketnights.com/membership-login/
    [2026/09/12 11:20:24] – SUCCESS: SwpmAuth::logout() – Logout request received for username: teacherPierce
    [2026/09/12 11:20:24] – SUCCESS: SwpmAuth::logout() – Logout actions executed successfully.
    [2026/09/12 11:22:36] – SUCCESS: Authentication request – Username: teacherpierce
    [2026/09/12 11:22:36] – SUCCESS: SwpmAuth::set_cookie() – Value of ‘remember me’ parameter:
    [2026/09/12 11:22:36] – SUCCESS: The ‘Remember me’ option is unchecked for this request, setting expiry to be a session cookie. The session cookie will expire when the browser is closed.
    [2026/09/12 11:22:36] – SUCCESS: Authentication successful for username: teacherpierce. Triggering swpm_after_login_authentication action hook.
    [2026/09/12 11:22:36] – SUCCESS: Trying wp_signon() with username: teacherpierce
    [2026/09/12 11:22:36] – SUCCESS: wp_authenticate action. Handling login for username: teacherpierce
    [2026/09/12 11:22:36] – SUCCESS: SwpmAuth::login()
    [2026/09/12 11:22:36] – SUCCESS: wp_login hook triggered. Username: teacherPierce
    [2026/09/12 11:22:36] – SUCCESS: Setting current WP user to: teacherPierce
    [2026/09/12 11:22:36] – SUCCESS: Triggering swpm_login_auth_completed_filter hook.
    [2026/09/12 11:22:36] – SUCCESS: Triggering swpm_after_login hook.
    [2026/09/12 11:22:36] – SUCCESS: After triggering the default swpm_after_login_redirect_url hook. Redirect URL: https://www.bracketnights.com/membership-login/
    [2026/09/12 11:23:29] – SUCCESS: SwpmAuth::logout() – Logout request received for username: teacherPierce
    [2026/09/12 11:23:29] – SUCCESS: SwpmAuth::logout() – Logout actions executed successfully.
    [2026/09/12 11:24:09] – SUCCESS: Authentication request – Username: teacherpierce
    [2026/09/12 11:24:09] – SUCCESS: SwpmAuth::set_cookie() – Value of ‘remember me’ parameter:
    [2026/09/12 11:24:09] – SUCCESS: The ‘Remember me’ option is unchecked for this request, setting expiry to be a session cookie. The session cookie will expire when the browser is closed.
    [2026/09/12 11:24:09] – SUCCESS: Authentication successful for username: teacherpierce. Triggering swpm_after_login_authentication action hook.
    [2026/09/12 11:24:09] – SUCCESS: Trying wp_signon() with username: teacherpierce
    [2026/09/12 11:24:09] – SUCCESS: wp_authenticate action. Handling login for username: teacherpierce
    [2026/09/12 11:24:09] – SUCCESS: SwpmAuth::login()
    [2026/09/12 11:24:09] – SUCCESS: wp_login hook triggered. Username: teacherPierce
    [2026/09/12 11:24:09] – SUCCESS: Setting current WP user to: teacherPierce
    [2026/09/12 11:24:09] – SUCCESS: Triggering swpm_login_auth_completed_filter hook.
    [2026/09/12 11:24:09] – SUCCESS: Triggering swpm_after_login hook.
    [2026/09/12 11:24:09] – SUCCESS: After triggering the default swpm_after_login_redirect_url hook. Redirect URL: https://www.bracketnights.com/membership-login/

    I just noticed that it redirects me back to the homepage, not to /membership-login/. I don’t know if that’s normal or not (I prefer it with the homepage redirect anyway) but I’ll mention it as it seems different from the logs.

    Thanks again for your help. I appreciate it. I can’t figure this one out on my own, haha.

    September 10, 2026 at 8:43 am in reply to: Issues after re-signing in #32298
    BracketNights
    Participant

    Thank you for your reply and help. I went through some of your suggestions, then found an update on the issue part way through, so I haven’t done the others yet. I don’t know whether they are relevant after the discovery listed below.

    Incognito mode: same issue happening.
    With ‘/?swpm-logout=true&nc=’ . time(): same issue happening.
    Added the ol’ ‘Header set Cache-Control’ etc to htaccess: same issue happening.
    I can’t find an active caching service on WP or my webhosting.

    Referred to issue: logout link is working again (the user seems to be logged out), but once logged out, certain pieces of php/js are being displayed as if the user is still logged in (piece of info from the user’s meta data) on multiple pages.

    However, UPDATE:
    If, in my php snippet, I replace “if ( is_user_logged_in() )” with “if ( SwpmMemberUtils::is_member_logged_in() )”, the issue goes away and the website works as intended.
    This suggests that the logout link (the default one on the profile page, as I have not created any other) is only logging out of the Simple Membership, not WordPress.
    Is this normal? Is this an error that can be fixed?

    September 5, 2026 at 2:09 pm in reply to: Issues after re-signing in #32295
    BracketNights
    Participant

    Ah, an update (I kept playing around trying to solve this):
    I noticed my user was registered twice (WP and SMP) whenever they sign up, but they have different user IDs. I deleted the users, synchronised WP and SMP memberships, then signed up as a member again. The problem persists – there are two accounts with two different IDs, the log-out function doesn’t work on the second sign-in, and certain data is missing or persists when it’s not supposed to.
    To test this further, I temporarily added the line onclick=”<?php wp_logout() ?>” to the sign-out link. This solved the initial problems. It now means that I can’t log in though (it signs me in, but immediately signs me back out again when I leave that page), so it’s not a long-term solution.
    This does, however, mean that the problem is identified – my users have two accounts (‘users’ and ‘membership’) which are not synced (even when that option is ticked in settings) and signing in/out of one does not sign in/out of the other, thus certain information persists and certain information doesn’t.

    Any ideas how to rectify this and stop the inability to log out or see all the data via php nonce request? Thanks!

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
Next Page »

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy