将这段代码添加到插件中即可。

$cookie = JFactory::getApplication()->input->cookie;
$session = JFactory::getSession();
$oldSessionId = $cookie->get('session-id');
$newSessionId = $session->getId();
if($oldSessionId != $newSessionId) {
    if($oldSessionId) {
        if($session->getId() != $oldSessionId) {
            $session->destroy();
        }
        session_id($oldSessionId);
        $session->start();
    } else {
        $cookie->set('session-id',$newSessionId);
    }
}