<?php session_start();

// Load required lib files
require_once('twitteroauth/twitteroauth.php');
require_once('config.php');

// Prepare a connection using a preset token
function getConnectionWithAccessToken($oauth_token, $oauth_token_secret) {
  $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token, $oauth_token_secret);
  return $connection;
}
 
$connection = getConnectionWithAccessToken(OAUTH_TOKEN, OAUTH_TOKEN_SECRET);
$content = $connection->get("search/tweets",
	array(
		'q' => 'twitter',
		'lang' => 'en',
		'count' => '5',
		'result_type' => 'mixed',
		'include_entities' => 'true'
	)
);

/* Include HTML to display on the page */
include('html.inc');

<?php session_start( session_id() ); // Include session_id() to maintain single session

// Load required lib files
require_once('twitteroauth/twitteroauth.php');
require_once('config.php');

// Prepare a connection using a preset token
function getConnectionWithAccessToken($oauth_token, $oauth_token_secret) {
  $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token, $oauth_token_secret);
  return $connection;
}
 
// Open connection
$connection = getConnectionWithAccessToken(OAUTH_TOKEN, OAUTH_TOKEN_SECRET);
// Save connection to session for use in includes files
$_SESSION['tweetoes_connection'] = $connection;

$content = $connection->get("search/tweets",
	array(
		'q' => 'twitter',
		'lang' => 'en',
		'count' => '5',
		'result_type' => 'mixed',
		'include_entities' => 'true'
	)
);

/* Include HTML to display on the page */
include('html.inc');

Set session id + Save connection to session
Set session id + Save connection to session

In order for additional PHP files to make requests to Twitter without
opening an entirely new connection (e.g, includes requested via AJAX),
the initial connection must be stored somewhere. This is best handled
by session variables.

In order for other PHP files to access the same session, the session id
must be set at session_start(). Each PHP file that requires access to
this session must open with the same id (i.e, session_id() ).

Now that the session_id() is set and the OAuth connection is saved,
twitter.php can be updated.
