I am trying to redirect my website to the homepage when the session expires and the user is automatically logged out (right now it gets redirected to the joomla core registration page, which I don't want the user to see because I have created my own registration page in a custom component).
In the index.php file of my template, I check if the session is active and perform a redirect if the session expired:
$session = JFactory::getSession();
if (!$session->isActive()) {
echo "session is expired";
header('Location: http://www.example.com/');
exit;
}else{
echo "session is active";
}
This solution worked fine up until the moment I updated to Joomla 3.4.5. After the update, even when the user is logged out automatically, it behaves as if the session is still active (I check that through the echo "session is active" line, as you can see above).
Why is the session still active even if the user is logged out ? Is there an alternative to the $session->isActive() method ?