Skip to content

Instantly share code, notes, and snippets.

@timbroder
Created October 17, 2011 19:06
Show Gist options
  • Save timbroder/1293475 to your computer and use it in GitHub Desktop.
Save timbroder/1293475 to your computer and use it in GitHub Desktop.
Creating a Stateless Request in Magento 1
<?php
...
if (!$this->getFlag('', self::FLAG_NO_START_SESSION)) {
$checkCookie = in_array($this->getRequest()->getActionName(), $this->_cookieCheckActions);
$checkCookie = $checkCookie && !$this->getRequest()->getParam('nocookie', false);
$cookies = Mage::getSingleton('core/cookie')->get();
if ($checkCookie && empty($cookies)) {
$this->setFlag('', self::FLAG_NO_COOKIES_REDIRECT, true);
}
Mage::getSingleton('core/session', array('name' => $this->_sessionNamespace))->start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment