Page 1 of 1

bizarre behavior after logging in newly registered user

PostPosted: August 22nd, 2011, 4:56 pm
by svillee
I have a WordPress site with s2Member Pro (build 110731) installed. I am using a PayPal Pro form to register a new user at level 1. The PayPal interaction proceeds normally, and when I return to my site, I get the message "Thank you. Your account has been approved. Please log in." However, when I try to log in, instead of going to the Login Welcome page, it gets redirected to this url:

Code: Select all
/?s2member_seeking=page-138&s2member_level_req=0


138 is the ID of the Login Welcome page. So even though I have entered the new username and password correctly, somehow it thinks I'm not logged in. At that point I'm in a kind of twilight zone where there's no easy way to log out. I have to manually enter this URL in order to log out:

Code: Select all
/wp-login.php?loggedout=true


This scenario is solidly reproducible. By adding some tracing code to plugins/s2member/includes/classes/pages.inc.php, I have determined that this code at lines 48 to 54 is deciding to redirect:

Code: Select all
                        $user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
                        /**/
                        if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && c_ws_plugin__s2member_no_cache::no_cache_constants (true) !== "nill" && (!$user || !current_user_can ("access_s2member_level0")) && $page_id != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
                           {
                              wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
                              exit ();
                           }


I have further determined that $user is false at this point, so is_user_logged_in() somehow returned false.

Any information on what the problem might be would be greatly appreciated. Thanks.

Re: bizarre behavior after logging in newly registered user

PostPosted: August 23rd, 2011, 2:01 am
by Cristián Lávaque
Thank you for reporting this.

Does your browser accept cookies? What browser are you using and have you tried with a different one too?

Could you update s2Member and s2Member Pro to the latest release (v110815) and try if the problem happens again?

If it does, could you please post the log entries for the transactions? WP Admin -> s2Member -> PayPal Options -> Account Details -> Enable Logging

Re: bizarre behavior after logging in newly registered user

PostPosted: August 23rd, 2011, 10:04 am
by svillee
Thanks for your reply.

I upgraded to the 110815 build, and the problem was still there, under both Firefox and Internet Explorer.

However, the problem went away when I deactivated the DB Cache Reloaded Fix plugin, so evidently there is some conflict there. I don't really need this plugin, so I'm happy with this solution.

Re: bizarre behavior after logging in newly registered user

PostPosted: August 23rd, 2011, 9:34 pm
by Cristián Lávaque
Ah, got it. Thanks for reporting what the problem was. I'm glad you solved it! :)