I am learning the basic concept of how to manage login process and sessions. I take it that to logout a user, you need to destroy the session created for him. I was trying to find out how joomla 3.4 handles "logout" action to verify whether I have correctly understand what I have learned. But I have trouble finding out which PHP file is actually taking care of the "logout" logic. Here is what I do:
Firstly, I think no matter what fancy(to me) library or framework Joomla is using, down to bottom, there should be a file receiving "$_POST" datas, so I searched $_POST
among all PHP files in my site, and I found this file "libraries/legacy/request/request.php" with this function
Class JRequest{
.....
public static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0)
{
// Ensure hash and type are uppercase
$hash = strtoupper($hash);
if ($hash === 'METHOD')
{
$hash = strtoupper($_SERVER['REQUEST_METHOD']);
}
$type = strtoupper($type);
$sig = $hash . $type . $mask;
// Get the input hash
switch ($hash)
{
case 'GET':
$input = &$_GET;
break;
case 'POST':
$input = &$_POST;
break;
case 'FILES':
$input = &$_FILES;
break;
case 'COOKIE':
$input = &$_COOKIE;
break;
case 'ENV':
$input = &$_ENV;
break;
case 'SERVER':
$input = &$_SERVER;
break;
default:
$input = &$_REQUEST;
$hash = 'REQUEST';
break;
}
.....
It seems to me Joomla has integrated "$_POST" data processing into this function so whenever Joomla wants to deal with user input, it will call this function. So I continue to search JRequest::getVar
among all PHP files, I found only 1 occurence, which is in components/com_meida/views/medialist/view.html.php
line 64
$dirname = JRequest::getVar('folder', '', '', 'string');
This doesn't look like having anything to do with login/logout processing. So I widen my search to just getVar
, although there are many occurences, none of them looks like relevant and this is where I got stuck.
Could you please not only point out the PHP file I am looking for but also tell me what is wrong with my approach? Thank you in advance.