Skip to content
Permalink
Browse files

Add support for "read-only" sessions through a special Magento contro…

…ller flag.
  • Loading branch information...
nemphys committed Apr 2, 2018
1 parent deddf3b commit a33684ebcdbeb53b0f2129a3bb6673903893adb2
Showing with 4 additions and 1 deletion.
  1. +4 −1 app/code/local/Cm/RedisSession/Model/Session.php
@@ -42,6 +42,8 @@
class Cm_RedisSession_Model_Session implements \Zend_Session_SaveHandler_Interface
{
const FLAG_READ_ONLY = 'cm-redissession-read-only';
/**
* @var int|null
*/
@@ -57,7 +59,8 @@ public function __construct()
try {
$this->sessionHandler = new \Cm\RedisSession\Handler(
new Cm_RedisSession_Model_Session_Config(),
new Cm_RedisSession_Model_Session_Logger()
new Cm_RedisSession_Model_Session_Logger(),
Mage::app()->getFrontController()->getAction() && Mage::app()->getFrontController()->getAction()->getFlag('', self::FLAG_READ_ONLY) ?: false
);
} catch (\Cm\RedisSession\ConnectionFailedException $e) {
$this->handleException($e);

0 comments on commit a33684e

Please sign in to comment.
You can’t perform that action at this time.