You need to send the variable to the function or use global.
session_start("mySessName");
// Now including and calling the function
include 'include/file.inc.php';
checkSessionName($mySessName);
(The function looks like)
function checkSessionName($mySessName)
{
}
if you want to return a new value to your session name use
$mySessName = checkSessionName($mySessName);
(function ends with : return($mySessName); )
global is easier (but less accurate)
include 'include/file.inc.php';
checkSessionName();
(The function looks like)
function checkSessionName()
{
global $mySessName;
// Change value over and over again is
// you want so.
}