<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: User registration &#62; login &#62; redirect to private page</title>
		<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page</link>
		<description>Gravity Support Forums Topic: User registration &gt; login &gt; redirect to private page</description>
		<language>en-US</language>
		<pubDate>Thu, 09 Apr 2026 17:03:10 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/user-registration-login-redirect-to-private-page" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-56947</link>
			<pubDate>Mon, 30 Apr 2012 08:09:16 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">56947@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm going to close this for now to keep support needs clean. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Andrew Munro on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-56937</link>
			<pubDate>Mon, 30 Apr 2012 02:31:38 +0000</pubDate>
			<dc:creator>Andrew Munro</dc:creator>
			<guid isPermaLink="false">56937@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Danny, worked great over here too :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>chrismalone617 on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-55009</link>
			<pubDate>Thu, 12 Apr 2012 03:02:02 +0000</pubDate>
			<dc:creator>chrismalone617</dc:creator>
			<guid isPermaLink="false">55009@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you Danny.  It works great.   Just what I needed to make my client happy!!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dimensionmedia on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-40676</link>
			<pubDate>Wed, 09 Nov 2011 21:25:20 +0000</pubDate>
			<dc:creator>dimensionmedia</dc:creator>
			<guid isPermaLink="false">40676@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Danny, i tried your code and it doesn't seem to be picking it up (seems to ignore it). So strange why it's ignoring the gform_user_registered hook there. The code is in functions.php. Any ideas?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Danny on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-40030</link>
			<pubDate>Fri, 04 Nov 2011 08:22:21 +0000</pubDate>
			<dc:creator>Danny</dc:creator>
			<guid isPermaLink="false">40030@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Here is a simple working solution for this. Tested and working with GF 1.6. This will work for any registration form out of the box.&#60;/p&#62;
&#60;p&#62;Simply set up what page you want to redirect to in the form options and then add the below code to your theme's functions.php file (this will take care of the auto login).&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action( &#38;#39;gform_user_registered&#38;#39;, &#38;#39;pi_gravity_registration_autologin&#38;#39;, 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-&#38;gt;user_login;
	$user_password = $password;

    wp_signon( array(
		&#38;#39;user_login&#38;#39; =&#38;gt; $user_login,
		&#38;#39;user_password&#38;#39; =&#38;gt;  $user_password,
		&#38;#39;remember&#38;#39; =&#38;gt; false
    ) );
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>mediana on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-39993</link>
			<pubDate>Thu, 03 Nov 2011 20:53:17 +0000</pubDate>
			<dc:creator>mediana</dc:creator>
			<guid isPermaLink="false">39993@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is there a way to get the GravityForm generated password to allow auto login ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>blrfurther on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-39819</link>
			<pubDate>Thu, 03 Nov 2011 02:07:43 +0000</pubDate>
			<dc:creator>blrfurther</dc:creator>
			<guid isPermaLink="false">39819@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sorry folks, I have not received any updates on this thread. I can assist anyone wanting top get this done. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//login after registration
add_action(&#38;quot;gform_user_registered&#38;quot;, &#38;quot;register_login_reload&#38;quot;, 10, 3);

function register_login_reload($user_id, $config, $entry) {    

	$user = new WP_User($user_id);

    $user_login = $_POST[&#38;#39;&#38;lt;your username input&#38;gt;&#38;#39;]; //use the input of the username in your form
    $user_pass  = $_POST[&#38;#39;&#38;lt;your password input&#38;gt;&#38;#39;]; //use the input of the password in your form

    //pass the above to the wp_signon function
    wp_signon( array(	&#38;#39;user_login&#38;#39; =&#38;gt; $user_login,
    					&#38;#39;user_password&#38;#39; =&#38;gt;  $user_pass,
    					&#38;#39;remember&#38;#39; =&#38;gt; false
    			   )
    		);

    $user = get_userdata($user_id);

   	wp_redirect( get_bloginfo(&#38;#39;url&#38;#39;).&#38;#39;/&#38;lt;where you want to redirect&#38;gt;&#38;#39;);

	}

Use the wp_redirect at the end of the code to redirect. Change the items inside &#38;lt;&#38;gt; to your specific site&#38;#39;s needs.&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;@bigflannel congrats on the writeup in SlideShowPro's news!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jeffreygaudette on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-39752</link>
			<pubDate>Wed, 02 Nov 2011 17:28:23 +0000</pubDate>
			<dc:creator>jeffreygaudette</dc:creator>
			<guid isPermaLink="false">39752@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks, Chris. Unfortunately, that doesn't work in my case and doesn't solve the issue. I do already have a redirect code in the functions.php that redirects users once they are logged in through the normal login process. &#60;/p&#62;
&#60;p&#62;My issue is that I have specific welcome areas that each registered member type needs to go to after they signup. If the user isn't logged in during the registration process, they can't see protected content (if I wanted to include it on this page) and I can't give them steps to perform member restricted actions.  I hope that further clarified my need for auto-login after registration. &#60;/p&#62;
&#60;p&#62;Thanks for the help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-39674</link>
			<pubDate>Wed, 02 Nov 2011 11:10:08 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">39674@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can handle the redirection in your page template.  I don't see any links to your site to know exactly how it should work in your case, but you can check in the page template if they're logged in, and if so, send them one place.  If they're not, show them the login form.&#60;/p&#62;
&#60;p&#62;I used code like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
&#38;lt;?php
/*
Template Name: Must log in
*/
if(!is_user_logged_in()) {
    $siteurl = get_bloginfo(&#38;#39;url&#38;#39;);
    $request = $_SERVER[&#38;#39;REQUEST_URI&#38;#39;];
    $redirect = urlencode($request);
    header(&#38;quot;Location: $siteurl/wp-login.php?redirect_to=$redirect&#38;quot;);
    exit;
}
get_header(); ?&#38;gt;
    &#38;lt;div id=&#38;quot;content&#38;quot;&#38;gt;
       your content here
    &#38;lt;/div&#38;gt;
&#38;lt;?php get_sidebar(); ?&#38;gt;
&#38;lt;?php get_footer(); ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This does not automatically log anyone in after registration, but it does handle directing them where they need to go, logged in or not.&#60;/p&#62;
&#60;p&#62;I have seen a couple threads on wordpress.stackexchange.com about automatically logging users in after registration, but I've never spent enough time on one to get it to work reliably.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jeffreygaudette on "User registration &#62; login &#62; redirect to private page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/user-registration-login-redirect-to-private-page#post-39643</link>
			<pubDate>Wed, 02 Nov 2011 07:37:03 +0000</pubDate>
			<dc:creator>jeffreygaudette</dc:creator>
			<guid isPermaLink="false">39643@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am also interested in a solution to auto login a user after form completion. Any idea on completion date since we're now at version 1.2.9?&#60;/p&#62;
&#60;p&#62;I have multiple registration forms that redirect to specific welcome pages, which give users the content they need. If they try to login from this page, they are redirected to the homepage, which means they can't get the information they need. If the user was already logged-in and directed to the welcome page by the form, it would work perfect.&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
