Insert user using GF and log them in
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
<!-- Use gform_after_submission hook. -->
if ( ! is_user_logged_in() ) {
// Log them in!
wp_set_current_user( $user_id, $user->user_login );
wp_set_auth_cookie( $user_id );
do_action( 'wp_login', $user->user_login );
}