variables - Access PHP Object from a loaded PHP in POST request
You can store it in the
$_SESSION and access it on the other pages.
On each page that you will use it you have to include the class.
So on both main.php and other.php:
require 'thisClass.php'; session_start();
$_SESSION['obj'] = $obj;
And on other.php
$obj = $_SESSION['obj'];
and you can use the object.