In my page I'm working on I put all the session stuff inside an include file. For every php page that I have, they all have
Code: Select all
require_once "includes/insult.inc";Code: Select all
session_start();
header("Cached-control: private");Now from how I understand the use of the $SESSION array, it works like a global and you can access it anywhere. I've got two variables that are set inside the insult.inc file as $_SESSION types $_SESSION['AI'] and $_SESSION['sound'], those two pass to any page just like they should. the variables $_SESSION['insult'] and $_SESSION['insult_URL]' get set inside a function in the same insult.inc file. Trouble is, the last two do not keep their contents between pages. I've tried taking them out of the functions, and moving them in various places, double checked spelling 8 times now by copy/pasting to make sure of spelling errors, but once I switch to another page, those last two become uindefined. I can echo their values out with
Code: Select all
echo $_SESSIONї'insult'];Any ideas? Are there any restrictions on $_SESSION variables for setting? I thought you could set them anywhere in your code once and then if you go to another page (provided the session_start is called on the next page as well) that they would still be defined. I do a
Code: Select all
print_r($_SESSION)help.
Paul