I am having the exact same problem as you, and while searching for an answer to this problem I came across this forum. I'm going to post the main file that setups up the the format of the include file.
Main File:
<?php
require("../config/config.inc.php");
include("teacher3.inc.php");
include("../config/layout.inc.php");
?>
<?php page_header(); ?>
<?php teacher_front_page(); ?>
<?php page_footer(); ?>
Teacher3.inc.php File:
<?php function teacher_front_page() {
require ("../config/config.inc.php");
?>
<h3 align=center>Homework Page Generator:</h3>
<br>
<blockquote>
<font size=4 color="red">
<?
print "Welcome " . $tusername . ",";
?>
I cut off like most of the teacher3.inc.php file, but thats all you need to see from it. I still don't understand why its not reading the cookies. I thought it had to do with the FUNCTIONs, but i guess it is the INCLUDE. Hope this helps for anyone willing to solve the problem. Thanks.