protected static function backupForeignSession()
{
$sName = self::getOption("name");
if ($sName != session_name()) {
// there's a different session in use, stop it and restart the admin session
self::$restoreSession = ["name" => session_name(), "id" => session_id()];
if (session_id()) {
@session_write_close();
}
if (isset($_COOKIE[$sName])) {
session_id($_COOKIE[$sName]);
}
return true;
}
return false;
}