is there anyone knows how to handle user login from a module and getting its generated session? which function i should call and what parameter i should send? and is it possible to handle user register from a module?

Thanks indeed,

Comments

kuldip zala’s picture

Hi,

You can get all the data in $user variable.
global $user;

Thanks.

si_odong’s picture

thanks for the answer, but global $user will return some value if the user already logged in. while, i'm asking how drupal handle user login? because now i'm developing a module to handle external application logging in to site and drupal helps to return its generated session. and finding out how drupal handle user register, so that i can accomodate external application sending some parameters to my site and registers a new user.

regards,

buddhika’s picture

I'm not sure if this will help. But you may get a better idea studying user module and this session function. http://api.drupal.org/api/function/sess_regenerate/5

si_odong’s picture

thanks all.. finally i can write a session on drupal, though at the end, i prefer using cookies than drupal sessions.. :P
but, many thanks to both of you.. :)