Skip Navigation

[Resolved] Auto login doesn't function when password is auto created

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 3 years, 10 months ago.

Assisted by: Jamal.

Author
Posts
#1674831

Tell us what you are trying to do? Use the auto login snipped from various forum posts. It works when the form option to 'auto-generate password' is off, but doesn't work when the option is active. Is there a way I can use the auto login while still auto generating a password?

Is there any documentation that you are following? https://toolset.com/forums/topic/auto-log-in-after-sign-up-with-user-form/

Is there a similar example that we can see?

What is the link to your site? hidden link

Many thanks
Matt

#1674965

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello Matt and thank you for contacting the Toolset support.

The example code from the ticket you have mentioned won't work for you, because that code provides an empty password, which is wrong, because a password was generated.

You will have to adapt the code to automatically log in the user without password, the following part of the code must be changed:

$user = array(
                'user_login'    =>   $_POST['user_email'],
                'user_password' =>   $_POST['user_pass'],
                'remember'      =>   true
            );
            $login = wp_signon( $user, false );

Instead, you can use one of the techniques described in these pages:
- hidden link
- https://wordpress.stackexchange.com/a/128445

I hope this helps. Let us know your feedback.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.