PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Auto login after registration with User Registration and Pay Pal Add-on's

  1. I would like to have a user automatically logged in after registering for a free trial. I current have the User Registration and Pay Pal Add-on's in place and properly configured. I added the following code to functions.php:

    add_action( 'gform_user_registered', 'pi_gravity_registration_autologin', 10, 4 );
    /**
    * Auto login after registration.
    */
    function pi_gravity_registration_autologin( $user_id, $user_config, $entry, $password ) {
    $user = get_userdata( $user_id );
    $user_login = $user->user_login;
    $user_password = $password;

    wp_signon( array(
    'user_login' => $user_login,
    'user_password' => $user_password,
    'remember' => false
    ) );
    }

    When I submit a registration without the Pay Pal integrated it registers the user and auto logs them into the site just fine. It's when I have the Pay Pal add-on running where the user is redirected to Pay Pal and returns to the site. The problem is that it is not auto-logging them into the site after returning from Pay Pal. The user is registered and can log in. Also, the payment/trial information is processing just fine. It just seems to be the auto login part that is not working.

    I'm almost certain it has something to do with the Pay Pal add-on, just not sure what. Please advise.

    Thank you.

    Posted 9 years ago on Monday February 18, 2013 | Permalink
  2. I'll close this topic and we'll resolve your issue via your priority support ticket.

    Posted 9 years ago on Monday February 18, 2013 | Permalink

This topic has been resolved and has been closed to new replies.