Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use redis for session #3860

Closed
kiatng opened this issue Feb 29, 2024 · 5 comments
Closed

Use redis for session #3860

kiatng opened this issue Feb 29, 2024 · 5 comments
Labels

Comments

@kiatng
Copy link
Contributor

kiatng commented Feb 29, 2024

Ref

case 'redis':
/* @var Cm_RedisSession_Model_Session $sessionResource */
$sessionResource = Mage::getSingleton('cm_redissession/session');
$sessionResource->setSaveHandler();
if (method_exists($sessionResource, 'setDieOnError')) {

Line 72: Mage::getSingleton('cm_redissession/session') is false. This is because Cm_RedisSession module was removed in PR #2411.

Trace:

Array
(
    [type] => 1
    [message] => Uncaught Error: Call to a member function setSaveHandler() on bool in /.../app/code/core/Mage/Core/Model/Session/Abstract/Varien.php:73
Stack trace:
#0 /.../app/code/core/Mage/Core/Model/Session/Abstract/Varien.php(273): Mage_Core_Model_Session_Abstract_Varien->start()
#1 /.../app/code/core/Mage/Core/Model/Session/Abstract.php(79): Mage_Core_Model_Session_Abstract_Varien->init()
#2 /.../app/code/core/Mage/Core/Model/Session.php(43): Mage_Core_Model_Session_Abstract->init()
#3 /.../app/code/core/Mage/Core/Model/Config.php(1460): Mage_Core_Model_Session->__construct()
#4 /.../app/Mage.php(544): Mage_Core_Model_Config->getModelInstance()
#5 /.../app/Mage.php(558): Mage::getModel()
#6 /.../app/code/core/Mage/Core/Controller/Varien/Action.php(495): Mage::getSingleton()
#7 /.../app/code/core/Mage/Adminhtml/Controller/Action.php(173): Mage_Core_Controller_Varien_Action->preDispatch()
#8 /.../app/co
    [file] => /.../app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
    [line] => 73
)

Preconditions (*)

In local.xml

<config>
  <global>
    ...
    <session_save>redis</session_save>
   ...
@kiatng kiatng added the bug label Feb 29, 2024
@kiatng
Copy link
Contributor Author

kiatng commented Feb 29, 2024

The file 'cm_redissession/session' is here: vendor\colinmollenhour\magento-redis-session\app\code\community\Cm\RedisSession\Model\Session.php. But I have no idea how to proceed.

$sessionResource = new Cm_RedisSession_Model_Session;

Fatal error: Uncaught Error: Class "Cm_RedisSession_Model_Session" not found

@m-overlund
Copy link
Contributor

i use
<session_save>db</session_save> for redis.
But i have also previously tried to use the other session_save without succes

@ADDISON74
Copy link
Contributor

Maybe @colinmollenhour could help you.

@colinmollenhour
Copy link
Member

If installed as a Magento module (it has "type":"magento-module", in composer.json) then it should be loading - technically if we used new instead of getSingleton then it would not be necessary for it to be a Magento module at all and just an "autoload" section in the compose.json would be sufficient to let it autoload. Does your compose environment have a magento module loader?

@kiatng
Copy link
Contributor Author

kiatng commented Mar 1, 2024

I'm not sure where to look if my composer environment has the magento module loader. I have this in the file vendor\composer\installed.json:

          {
            "name": "magento-hackathon/magento-composer-installer",
            "version": "4.0.2",
            "version_normalized": "4.0.2.0",
            "source": {
                "type": "git",
                "url": "https://github.com/Cotya/magento-composer-installer.git",
                "reference": "ece5cc5bb2a0150a743619901543036597f9eb5b"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/Cotya/magento-composer-installer/zipball/ece5cc5bb2a0150a743619901543036597f9eb5b",
                "reference": "ece5cc5bb2a0150a743619901543036597f9eb5b",
                "shasum": ""
            },
            "require": {
                "composer-plugin-api": "^2.0",
                "flyingmana/composer-config-reader": "*",
                "php": ">=5.5",
                "symfony/console": "^2.5|^3.0|^4.0|^5.0"
            },
            "require-dev": {
                "composer/composer": "2.*",
                "cotya/composer-test-framework": "~2.0",
                "ext-json": "*",
                "mikey179/vfsstream": "~1.4",
                "phpunit/phpunit": "~4.3",
                "phpunit/phpunit-mock-objects": "~2.3",
                "squizlabs/php_codesniffer": "~2.1",
                "symfony/process": "~2.5"
            },
            "suggest": {
                "colinmollenhour/modman": "*",
                "theseer/autoload": "~1.14"
            },
            "time": "2022-04-20T19:23:22+00:00",
            "bin": [
                "bin/magento-composer-installer.php"
            ],
            "type": "composer-plugin",
            "extra": {
                "class": "MagentoHackathon\\Composer\\Magento\\Plugin"
            },
            "installation-source": "dist",
            "autoload": {
                "psr-0": {
                    "MagentoHackathon\\Composer": "src/"
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "OSL-3.0"
            ],
            "authors": [
                {
                    "name": "Daniel Fahlke aka Flyingmana",
                    "email": "flyingmana@googlemail.com"
                },
                {
                    "name": "Jörg Weller",
                    "email": "weller@flagbit.de"
                },
                {
                    "name": "Karl Spies",
                    "email": "karl.spies@gmx.net"
                },
                {
                    "name": "Tobias Vogt",
                    "email": "tobi@webguys.de"
                },
                {
                    "name": "David Fuhr",
                    "email": "fuhr@flagbit.de"
                },
                {
                    "name": "Vinai Kopp",
                    "email": "vinai@netzarbeiter.com"
                }
            ],
            "description": "Composer installer for Magento modules",
            "homepage": "https://github.com/magento-hackathon/magento-composer-installer",
            "keywords": [
                "composer-installer",
                "magento",
                "openmage"
            ],
            "support": {
                "issues": "https://github.com/Cotya/magento-composer-installer/issues",
                "source": "https://github.com/Cotya/magento-composer-installer/tree/4.0.2"
            },
            "funding": [
                {
                    "url": "https://github.com/sponsors/Flyingmana",
                    "type": "github"
                },
                {
                    "url": "https://www.patreon.com/Flyingmana",
                    "type": "patreon"
                }
            ],
            "install-path": "../magento-hackathon/magento-composer-installer"
        },

Is this it? I'd appreciate any help as I am quite clueless.

@OpenMage OpenMage locked and limited conversation to collaborators Mar 1, 2024
@kiatng kiatng converted this issue into discussion #3861 Mar 1, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

4 participants