[development] Super Ninja Question: Auto-creating user and logging in (worth +15 magic points)

Ivan Sergio Borgonovo mail at webthatworks.it
Fri Jan 25 09:17:24 UTC 2008

On Thu, 24 Jan 2008 22:25:27 -0800
Rob Barreca <rob at electronicinsight.com> wrote:

> *My question:* How would I give this anonymous user his/her legit 
> session all in this same page hit so any AJAX calls they make from
> this same page (remember, no redirect!) will pass the good cookie,
> not this anonymous cookie (mmm, chocolate).

I'm not an AJAX Ninja but why don't you build up a hook that call
similar stuff in modules/user.module user_login_submit/validate?

You will get back the right changed session without a redirect.

The main problem could be delaying user login hooks of other modules:

user_module_invoke('login', $form_values, $user);

Ivan Sergio Borgonovo

More information about the development mailing list