Creating a custom session in a store view's index.php in a subdirectory of the main magento installion.
The code I added is as follows:
require_once $mageFilename;
Mage::init();
Mage::getSingleton('core/session')->setRefer("access");
$refer = Mage::getSingleton('core/session')->getRefer();
echo $refer;
I added the code under require_once $mageFilename; in index.php otherwise I would get Mage errors.
I want to use the session for something more complex but I can't get even this basic code to work!
This causes the mantenance page to display for some reason with access echod at the top of the page. Maintenance displays even when I take out the code which displays the maintenence page inside the index.php.
Any advice is greatly appreciated!
EDIT1:
When moving my code to bottom of file:
$mageRunCode = 'mystore';
$mageRunType = 'store';
Mage::run($mageRunCode, $mageRunType);
Mage::getSingleton('core/session')->setRefer("denied");
$refer = Mage::getSingleton('core/session')->getRefer();
if($refer == "access") {
}else{
include_once 'XXXXXXXXX/503.php';
exit;
}
This makes my store view appear and then stacks the maintenance page below it!