Thanks for that Krileon your explanation has helped me to sort my problem.
I accept going to a url held in session for 3 or more page loads could cause issues however in this instance I think it is not an issue.
As the page loads are one after the other with no user interaction plus the way I have set the return url in the session it would take some work to reload another page.
What I have done from the start is:
1. Add your auto login code to the Auto Actions plugin found at:
www.joomlapolis.com/forum/153-professional-member-support/185909-solved-automatic-login-after-registration#185947
2. For the 2nd part of your above instruction I have added the url as "return_url".
3. I changed the file components/com_comprofiler/plugin/user/plug_cbautoactions/models/redirect.php
At line 31 I added:
Code:
} elseif ( strtolower( $redirect ) == 'return_url' ) {
$url = (isset($_SESSION['comprofiler']['return'])) ? base64_decode($_SESSION['comprofiler']['return']) : $_CB_framework->userProfileUrl();
cbautoactionsClass::setRedirect( $url, $message, ( $message ? $message_type : null ) );
}
The first line checks if you have entered the phrase "return_url" in the URL box of the Auto Actions plugin as CB already uses the phrase "return".
4. Added an Auto Action (type = code, trigger = onBeforeRegisterFormDisplay)
Code:
if (isset($_SESSION['comprofiler']['return'])) unset ($_SESSION['comprofiler']['return']);
if (isset($_GET['return'])) $_SESSION['comprofiler']['return'] = $_GET['return'];
User is now registered, logged in and redirected back to my component with the url I supplied.
I nearly got there without any core modifications of CB.
I am just wondering if you had any thoughts on this. I don't know about anyone else but I think this would be a great addition to community builder, but I accept very few people would ever need to use it.
Just people like me who have created components.
Thanks
Mike