I'm trying to Dynamically Generate a Session Index and Check if isset. When the page that checks if its set loads I get an Unidentified Index error. Is there a way I could Set it to 0 or 1 when a Visiter firsts visits the site but doesn't re-write that value on Page Load which it would do if I fired it on init in the Page.php?
Here is my Check Function in my PageType.php if it helps
function CodeCheck(){
$arIndex= strtolower(str_rot13(str_ireplace(" ","",$this->Title)));
if ($_SESSION[$arIndex] == strtolower($this->AccessCode)) {
return true;
}
else
{
return false;
}
}
As you can see it checks $_SESSION[$arIndex] for a specific value, however if the User Hasn't visited this page its not set and I get the UnIdentified Index error. If I write something to it in the init() function it gets over written with each page load thereby erasing the Visitor submitted data.
Is there an existing $_SESSION array in the system that only gets written on the Visitors FIRST pageload?