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

[Resolved] Logout Link Not working

Simple Membership Plugin › Forums › Simple Membership Plugin › Logout Link Not working

Tagged: cookies, Logout, simple membership

  • This topic has 26 replies, 4 voices, and was last updated 8 years, 5 months ago by The Assurer.
Viewing 15 posts - 1 through 15 (of 27 total)
1 2 →
  • Author
    Posts
  • February 8, 2018 at 12:21 am #13259
    gphsupport
    Participant

    I have used the suggested method ( https://simple-membership-plugin.com/creating-member-logout-link/ ) and have a login link on my site ( https://www.stiraallternatives.com/aviate/ ) but it’s not working.

    The site is in a subfolder (which i seen noted on other threads/tickets; although none of the threads list any solution). And I see one cookie (swpm_session) is on Path: / while all others (swpm_in_use, simple_wp_membership…, wordpress_sec…, wordpress_logged_in…) are all on Path: /aviate/.

    Clicking ‘Logout’ does the redirection, but doesn’t clear any cookies.

    Ironically, I have this same setup on another server and it works fine.

    Logs aren’t helpful:

    log.txt
    [02/07/2018 3:51 PM] – SUCCESS: After login redirection addon. Checking if member need to be redirected.
    [02/07/2018 3:55 PM] – SUCCESS: After login redirection addon. Checking if member need to be redirected.
    [02/07/2018 4:04 PM] – SUCCESS: After login redirection addon. Checking if member need to be redirected.
    [02/07/2018 4:04 PM] – SUCCESS: After login redirection addon. Checking if member need to be redirected.
    log-auth.txt
    [02/07/2018 3:51 PM] – SUCCESS: Authentication request – Username: financial-pro
    [02/07/2018 3:51 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
    [02/07/2018 3:51 PM] – SUCCESS: Trying wp_signon() with username: financial-pro
    [02/07/2018 3:51 PM] – SUCCESS: Setting current WP user to: financial-pro
    [02/07/2018 3:51 PM] – SUCCESS: Triggering swpm_after_login hook.
    [02/07/2018 3:55 PM] – SUCCESS: Authentication request – Username: financial-pro
    [02/07/2018 3:55 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
    [02/07/2018 3:55 PM] – SUCCESS: Trying wp_signon() with username: financial-pro
    [02/07/2018 3:55 PM] – SUCCESS: Setting current WP user to: financial-pro
    [02/07/2018 3:55 PM] – SUCCESS: Triggering swpm_after_login hook.
    [02/07/2018 4:03 PM] – SUCCESS: login
    [02/07/2018 4:03 PM] – SUCCESS: Authentication request – Username: AviateAdmin
    [02/07/2018 4:04 PM] – SUCCESS: Authentication request – Username: financial-pro
    [02/07/2018 4:04 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
    [02/07/2018 4:04 PM] – SUCCESS: Trying wp_signon() with username: financial-pro
    [02/07/2018 4:04 PM] – SUCCESS: Setting current WP user to: financial-pro
    [02/07/2018 4:04 PM] – SUCCESS: Triggering swpm_after_login hook.
    [02/07/2018 4:04 PM] – SUCCESS: Authentication request – Username: financial-pro
    [02/07/2018 4:04 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
    [02/07/2018 4:04 PM] – SUCCESS: Trying wp_signon() with username: financial-pro
    [02/07/2018 4:04 PM] – SUCCESS: Setting current WP user to: financial-pro
    [02/07/2018 4:04 PM] – SUCCESS: Triggering swpm_after_login hook.
    [02/07/2018 4:05 PM] – SUCCESS: Authentication request – Username: financial-pro
    [02/07/2018 4:05 PM] – SUCCESS: Authentication successful for username: financial-pro. Executing swpm_login action hook.
    [02/07/2018 4:05 PM] – SUCCESS: static function swpm_login(). User is logged in. WP Username: financial-pro

    Any ideas?

    February 8, 2018 at 12:32 am #13260
    The Assurer
    Moderator

    Clicking ‘Logout’ does the redirection, but doesn’t clear any cookies.

    Is the problem; the user is still logged in, or that you still see the cookie?

    February 8, 2018 at 12:34 am #13261
    gphsupport
    Participant

    Ah, yes, the problem is that the user is still logged in.

    I would assume those are the same problem in this case. I know how it normally works is that the cookie time is just set in the past and that ends up clearing it out in the browser.

    February 8, 2018 at 12:39 am #13262
    gphsupport
    Participant

    For developing the site, I’ve been having to manually delete all the cookies to logout.

    There is no apparent issues logging in. The logout feature just doesn’t work.

    In case it helps, here’s a plugin list:
    Better Search Replace, Bootstrap MCE CSS, Contact Form 7, Custom Permalinks, Disable Title, Flamingo, Include Me, Insert PHP, Jquery Validation for Contact Form 7, Really Simple SSL, Search Everything, Simple Membership After Login Redirection, Simple Memebership Custom Messages, Simple WordPress Membership, TinyMCE Advanced, URL ShortCodes, Varnish HTTP Purge

    The other setup where I have this running another domain is nearly identical (also running Varnish; no other caching). The only difference is that this one is in a subdomain. =/

    February 8, 2018 at 1:30 am #13263
    John SF
    Participant

    I am also not getting the logout link (recommended shortcode version) to work. My WP installation is in a sub directory. Is that why? If so, is there a work-around?

    February 8, 2018 at 3:33 am #13269
    The Assurer
    Moderator

    The site is in a subfolder (which i seen noted on other threads/tickets; although none of the threads list any solution). And I see one cookie (swpm_session) is on Path: / while all others (swpm_in_use, simple_wp_membership…, wordpress_sec…, wordpress_logged_in…) are all on Path: /aviate/.

    Question: Is the WordPress instance for “aviate” the only WordPress instance you have on the stiraallternatives.com domain that is running the simple-membership plugin? Or are you running the plugin in more than 1 subdirectory or subdomain on the same server?

    Yes, I see the plugin is using the root “/” path and the entire domain, for the swpm_session cookie, while all other cookies are using COOKIEPATH and COOKIE_DOMAIN in the setcookie() calls. This will be investigated.

    Also, which browser and version are you using?

    February 8, 2018 at 3:43 am #13271
    gphsupport
    Participant

    The root is running a WordPress installation, but IS NOT running the Simple Membership plugin. Simple Membership is running on no other subdirectories or subdomains on this server.

    The “aviate” folder is the only WordPress instance on this server and is the only one running the Simple Membership plugin.

    Yep, also see that.

    February 8, 2018 at 6:11 am #13273
    admin
    Keymaster

    We intentionally set the cookie path to the root domain for the login session. However, the logout should still work fine given you are creating the link properly.

    If your WordPress install is on a sub-folder, the logout link should be something like the following. Is that what you are using?

    stiraallternatives.com/aviate/?swpm-logout=true

    February 8, 2018 at 4:37 pm #13279
    gphsupport
    Participant

    Correct. Well, I use PHP code, but that is what is output:
    <?php bloginfo(‘url’); ?>/?swpm-logout=true

    And it looks like this in the HTML:
    http://www.stiraallternatives.com/aviate/?swpm-logout=true
    (except on https; but if I type that in, it shows the website in a frame, which is kind of annoying)

    February 8, 2018 at 4:38 pm #13280
    gphsupport
    Participant

    Ugh, sorry, I didn’t realize it would insert it as a frame like that.

    February 8, 2018 at 5:17 pm #13281
    gphsupport
    Participant

    I made a test login for you in case it helps you diagnose anything.

    Username: test
    Password: test
    Redirect on login: https://www.stiraallternatives.com/aviate/test/

    February 8, 2018 at 5:53 pm #13282
    gphsupport
    Participant

    Also, Re:

    https://simple-membership-plugin.com/forums/topic/common-reasons-for-member-login-related-issues/
    https://simple-membership-plugin.com/forums/topic/test-for-plugin-and-theme-conflict-before-posting-an-issue-or-a-bug/

    I did both the theme and plugin tests. Disabled the theme, used the default, same issue. Disabled all plugins except Simple Membership, same issue.

    February 8, 2018 at 6:00 pm #13283
    gphsupport
    Participant

    Sorry, I missed this:

    Also, which browser and version are you using?

    Chrome Version 64.0.3282.140 (Official Build) (64-bit)
    Firefox Quantum 58.0.2 (64-bit)

    February 8, 2018 at 6:58 pm #13284
    The Assurer
    Moderator

    @gphsupport
    I just tried your test account…
    * First time Login / Logout was successful.
    * Subsequent Login / Logout are unsuccessful.
    * Deleting all cookies returns me to a logged out state.
    * Subsequent Login / Logout are unsuccessful.
    Are you using any kind of page caching or CDN service?

    February 8, 2018 at 7:03 pm #13285
    gphsupport
    Participant

    No CDN. No page caching (or WordPress caching modules of any kind). But there is Server level caching–yeah, Varnish. And, I just realized my Varnish configuration actually isn’t running on my other host due to phpsessions. So, maybe that was why it was working there and not here. Is the plugin not compatible with Varnish?

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 27 total)
1 2 →
  • You must be logged in to reply to this topic.
Log In

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