Problem with package using sessions


im experiencing a weird problem with this package moltin/cart: when i use the init script of Advanced Application Template to initialize it in development everything works fine. But when i use the init script to initialize the SAME application in production mode the cart is not adding items anymore.

The rest of the session related stuff is working like flash, user authentication, also writing to the session. The whole cart-part of the session is missing in comparison to dev environment.

When i dump the $config the only real difference is the use of the Debug-Module.

Do i need to boostrap anything special in production environment to make the package work?(working on the SAME machine in different environment)


Through further testing i found that the cart is working if i include the debug-module and put the module in the boostrap part of the config(and ONLY then).

The only parts i could find regarding the session in the debug module is this:

    protected function getFlashes()


        /* @var $session \yii\web\Session */

        $session = Yii::$app->has('session', true) ? Yii::$app->get('session') : null;

        if ($session === null || !$session->getIsActive()) {

            return [];


        $counters = $session->get($session->flashParam, []);

        $flashes = [];

        foreach (array_keys($counters) as $key) {

            if (array_key_exists($key, $_SESSION)) {

                $flashes[$key] = $_SESSION[$key];



        return $flashes;


Does someone have any idea why this would change anything and how i can reproduce this to make the package work without bootstrapping the debug-module in production? Sorry for double-post