User not being automatically logged in

14 replies [Last post]
damien
Offline
Joined: 09/08/2009
Status: 
Answered

 Hi Leighton,

I've setup the module and enabled a sandbox account to test.  Once I go through the whole process, when it returns me to my original site, the user is not automatically logged in.  I need to wait for the email to be generated, and can then get the login or one-time link to access our site.

Also, in the reporting, the Monthly income and total increase as expected, but the 'total subscriptions sold' remains at 0.

Otherwise, great module :)

Leighton Whiting
Offline
Joined: 06/02/2009
Damien, Sorry for getting

Damien,
Sorry for getting back to this late, I didn't see the post until just now. First of all, can you confirm that the 'Log in users automatically' option is turned on and that the thank-you page is set to the default settings of blank? Currently, the auto-login only works with the default thank-you page (although I am planning to extend this to work with ANY thank you page in the next release).

As for the Reports, I am working on a new Charts module that will be bundled with the Subsriptions module (free of charge) that will overhaul this section and add in nice graphs.

Sincerely,
Leighton

Leighton Whiting
Offline
Joined: 06/02/2009
The new release of Paypal

The new release of Paypal Subscriptions 4.8 no longer requires you to use the default thank you page for Automatic Login to work.
Also, I added in the new Flash Charts to replace the old Reports page. Enjoy :)

-Leighton

damien
Offline
Joined: 09/08/2009
 Sorry Leighton,  the auto

 Sorry Leighton,  the auto login is still not working.  Does it matter that I'm in sandbox mode?

 

I orginally thought it might have been that I had 'require email verification' on, but even after removing it, it still wont log me on.

 

Alos, I tried downloading 4.8, but it keeps giving me the 4.7 zip file.

 

cheers

damo

 

Leighton Whiting
Offline
Joined: 06/02/2009
Damien, I just tried

Damien,
I just tried downloading the file from your account, and it downloaded 4.8 for me. Are you going to My Account -> Files ? I will send you a copy of it. Try it with the new version and let me know if it works.

Sincerely,
Leighton Whiting

steven.itterly
Offline
Joined: 01/10/2010
Auto Login not working

Hi Leighton,

I am working with version 5.2 for drupal 6, and everything is working great but the autologin is not working whether I use the default thankyou page or my own success url.  Is this an issue that you know of, or could you point me to the spot in the code where I can check this?

thanks,

steve

Leighton Whiting
Offline
Joined: 06/02/2009
Steven, The auto-login should

Steven,
The auto-login should be working, but I suggest upgrading to 5.3, since 5.2 had a bug relating to saving the Membership Plans. You don't need to run update.php if you are just upgrading from 5.2.

The spot in the code would be line 1093, that entire function.

Sincerely,
Leighton Whiting

steven.itterly
Offline
Joined: 01/10/2010
Leighton, I upgraded, and

Leighton,

I upgraded, and checked out the code, but I still can't get the autologin to work... it will redirect to the right page, but no auto login... what do you think i could be doing... I have it set properly in settings as well

thanks,

steve

steven.itterly
Offline
Joined: 01/10/2010
So I tried putting this in

So I tried putting this in the beginning of the thankyou page function:

/**
 * Show the default thankyou page
 */
function ms_membership_thankyou_page() {
  //Auto Login the user if available

  global $user;
  $ipn = $_POST;

    print('<pre>');
    print_r($ipn);
    print('</pre>');   
    exit();

so I could see what was coming through in the $_POST, but nothing prints.  It just redirects to my Success Url without auto logging in.  This seems to imply that this may not be the correct function that is being called.  Any ideas?

thanks,

Steve

steven.itterly
Offline
Joined: 01/10/2010
So the customVars field from

So the customVars field from IPN in the system log looks like this:

Custom Vars: Array ( [name] => asdf [mail] => asdfasdfasdf@yahoo.com [mpid] => 2 [timezone] => -25200 [op] => Create new account [submit] => Create new account [form_build_id] => form-2260649971ae0297be4dc17d901d4680 [form_id] => user_register [ms_membership_submit] => Array ( [0] => user_register_submit ) [type] => role subscription [paymentId] => 30 )

The only place in ms_membership_thankyou_page() where there seems to be an autologin happening is here:

      if ($customVars['uid']) {
        for ( $counter = 1; $counter <= 10; $counter += 1) {
          if ($uid = db_result(db_query("SELECT uid FROM {users} WHERE uid=%d", $customVars['uid']))) {
            // Automatically Log the User in
            $user = user_load($customVars['uid']);
            if ($user->uid) {
              // Redirect the Thankyou Page if set
              if ($m_plan->return_url) {
                drupal_goto($m_plan->return_url);
              }
              else {
                $content = theme('ms_membership_thankyou_page', 0, 1, 0, $user);
              }
            }
            break;
          }
          else {sleep(5);}
        }
      }

The $customVars['uid'] field doesn't appear to be set from the IPN, therefore not autologging in.  How/when would this value be set?

Thanks, and sorry for the bombardment.

Steve

Leighton Whiting
Offline
Joined: 06/02/2009
Steve, I think I know what

Steve,
I think I know what the issue is. But just for testing, can you try it with the default thankyou page (just leave the Success URL blank for the default) and let me know if it logs the user in?

This will help me narrow down the problem.

Sincerely,
Leighton Whiting

kuroi
Offline
Joined: 12/04/2009
I too have the "not logged in" problem

I am the same issue - newly created users not logged in after successful payment .

so picking up on this thread here's what I have (in a simple site  just to test this issue):

Drupal 6, Moneyscripts Membership Shuite 6.x-5.6 & using the default Thankyou page

All processing works OK except leaving user logged in,

So I included the code from post #8 on this thread at the start of the thankyou page function:

function ms_membership_thankyou_page() {
  //Auto Login the user if available
  global $user;
  $ipn = $_POST;

    print('<pre>');
    print_r($ipn);
    print('</pre>');  
    exit();

 

What I get out is:

  1. (
  2.     [merchantReturn_x] => Return to Merchant
  3.     [auth] => QSfIdBl2MkYpsZgyp5SoaSEUiYozrkcXRQJik5Zl8LmSKeViDp1_gkobmMwZPEHGeg0WxjM40czy9ujV
  4.     [form_charset] => UTF-8
  5. )

  1.  

  1. did it again as drupal_set_message and got nothing!

  1. Please help
  2.  
  3. Regards
  4. Adrienne

Leighton Whiting
Offline
Joined: 06/02/2009
I think I may have found the

I think I may have found the problem for this. PayPal doesn't return the IPN information when 'Auto-Return' is set in your PayPal Profile. If you want Auto-Login to work, this must be turned off. I am looking into a way to fix this so that it will still work even with it on, but in the mean time, can you test if turning it off fixes the issue?

Sincerely,
Leighton Whiting

daemonicus
Offline
Joined: 07/05/2011
Still not working

Still not working "Automatically Login New Users" function. Another solution?

Leighton Whiting
Offline
Joined: 06/02/2009
Can you open a new topic

Can you open a new topic instead? The auto-login system has changed so that the issues in this post have been fixed. One thing to check is to see if there are any errors in the logs, and if the order is being marked as completed or not.

Sincerely,
Leighton Whiting

Twitter Feed