Home Forums Plugin Support WP User Frontend (Free Version) Auto Login After Registration

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Nayem 3 years, 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #40192

    Marco Coco
    Member
    Post count: 42

    Hello,
    I would like that the user after clicking on the registration link sent via email (after the complete the registration form), log-in automatically without that he must enter your username and password.

    How can I do?

    Thanks in advance

    #40234

    Nayem
    Moderator
    Post count: 6480

    Hello Marco,

    You can visit here to get some idea about how to do this work – http://stackoverflow.com/questions/19949876/how-to-auto-login-after-registration-in-wordpress-with-core-php.

    Thanks.

    #40236

    Nayem
    Moderator
    Post count: 6480

    In your theme's function.php file you can insert those code to enable auto login after registration-

    function auto_login_new_user( $user_id ) {
            wp_set_current_user($user_id);
            wp_set_auth_cookie($user_id);
                // You can change home_url() to the specific URL,such as 
            //wp_redirect( 'http://www.wpcoke.com' );
            wp_redirect( home_url() );
            exit;
        }
     add_action( 'user_register', 'auto_login_new_user' );
    #40237

    Marco Coco
    Member
    Post count: 42

    Thanks but i want that users After that he click the email, automatically log-in, and not when he finish the registration form. How can i do that?

    #40239

    Nayem
    Moderator
    Post count: 6480

    Hello,

    It will require more customization. I am really sorry to say that i can not help you about this. You may require a developer to do this for you. We do not provide support for customization. We only provide support for our built in feature.

    Thank you ๐Ÿ™‚

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Auto Login After Registration’ is closed to new replies.