WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
[resolved] Login redirects but doesn't login the user (8 posts)

  1. huracan
    Member
    Posted 1 year ago #

    This website I'm working wants the user to be redirected to the member-only blog content after a successful login. This seems to be easily accomplished with the redirect filter.
    add_filter( 'wpmem_login_redirect', 'my_login_redirect' );
    The behavior I get, however, is the user appears to login ok (i.e., no failure is given and it redirects OK), but the blog content is blocked and the status widget shows the user not logged in. So, somehow the login fails, no failure is given and the redirect occurs anyway. Any ideas are much appreciated. Thanks!

    http://wordpress.org/extend/plugins/wp-members/

  2. huracan
    Member
    Posted 1 year ago #

    Additional data: while in the redirected area, I clicked on the "Forgot Password" link (in the Login Status widget), and voila, I was now considered logged in. Most weird....

  3. Chad Butler
    Member
    Plugin Author

    Posted 1 year ago #

    I'm wondering if you have something that is interfering with the WP-Members process of setting the authentication cookie. You might want to try disabling other plugins and retesting to see if something is in conflict.

  4. huracan
    Member
    Posted 1 year ago #

    I'll try that for sure. What's the name of the cookie - that way I can check to see if it's set after login.

    Thanks.

  5. huracan
    Member
    Posted 1 year ago #

    ok - after hitting the "Forgot Password" link in the Login Status widget and therefore being shown as logged in (per the second post above), I see a cookie with the name "wordpress_logged_in_60c....." I assume this is the one. And indeed I did not see it when the strange behavior was observed. So, you hit the nail in the head. Now, I need to figure out why the cookie isn't being set .......

    Thanks.

  6. huracan
    Member
    Posted 1 year ago #

    It appears I misspoke in the previous post. The cookie is being set (it's actually 3 cookies), but wp-members doesn't see it until I navigate to another page, as though there is a race condition between building the redirected page and setting of the cookie. If I examine cookies while the Login Status widget claims "logged out", I see the cookie set.

    My apologies for my stream of debugging reports; just hoping it might match something someone has seen before.....

  7. Chad Butler
    Member
    Plugin Author

    Posted 1 year ago #

    It sounds like something else is sending things downstream at a different execution point. I think what you need to start with is deactivating other plugins to see what is in conflict.

  8. huracan
    Member
    Posted 1 year ago #

    OK, here's the scoop: the base of the url I was redirecting to was not the main base for the site. That is, I have two urls that land in the same site, but only one of them can be the main one. Somehow, this causes the condition I saw, probably due to timing. Maybe it takes another dip to the server to resolve, I dunno. I changed the url to use the main base and now the redirection works fine. I'll mark the problem resolved. Now, the login page rendering is messed up, but I'll work on that first before I post anything.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic