I've two forms: (login form, register form) plus they posted to my component.

Login form: I wish to check login and pass and hang status to "drenched" in joomla.

Register form: I would like register new user in joomla.

How to get it done?

$inplogin = JRequest::getVar('inplogin');
$inppass = JRequest::getVar('inppass');

???? JFactory::login($inplogin, $inppass); ????

???? JFactory::registeruser($inplogin, $inppass); ????

???

For Login

$result = JFactory::getApplication()->login(array('username'=>$username, 'password'=>$password));

For Registration

require_once  JPATH_ROOT.DS.'components'.DS.'com_users'.DS.'models'.DS.'registration.php';
$model = new UsersModelRegistration();
jimport('joomla.mail.helper');

// Attempt to save the data.
jimport('joomla.user.helper');
$username = ; //your user name here
$password = ; //your password here
$data = array(  'username'=>$email,'name'=>$email,'email1'=>$email,'password1'=>$password, 'password2'=>$password, 'block'=>1 );
$return = $model->register($data);

I do not observe how this really is related particularly to joomla.

you should utilize exactly the same $_SESSION variable in the two cases. once you declare the variable, you should check on the start of your index page if the var is available (and when so, if the qualifications are correct or otherwise). something similar to:

    <?php 
    session_start();
    if (!isset($_SESSION['logged']) {
    header("location:login.php");
    exit();
    }
    ?>

you should use JUser::bind($userData) and JUser::save($userData) for signing up the consumer.