Hi All

Is there any way to automatically log a user in?

I want to create a new account for a user and then log them in automatically after I have created the new user account. I know "user_load" returns a full user object but does this log the uid in as well?

Thanks
Ross

Comments

agarwal.sudhanshu’s picture

You can use Logintoboggan Module which provides this functionality.
Project page: http://drupal.org/project/logintoboggan

mwskuzzy’s picture

thanks for the quick reply but i specifically need to do this through code. Does this module provide specific methods to do this?

Thanks

ashishn.cms’s picture

Hello,
When user register then he may login after created account & it is fulfilled by logintobogan module then why you want to do that by code can you specify your requirement briefly.

Thanks

mwskuzzy’s picture

Hi

I have a custom order process which uses web forms module. I would like to allow a user to order a product without having to register and then after they have specified their email address and details I want to create a user account and log them in automatically via code. This is stupid I know but my boss is insisting on this method.

Thanks