Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

SessionStorage object won't array merge #10

Closed
basz opened this issue Nov 5, 2015 · 5 comments
Closed

SessionStorage object won't array merge #10

basz opened this issue Nov 5, 2015 · 5 comments

Comments

@basz
Copy link

basz commented Nov 5, 2015

When I configure session storage to use the Zend\Session\Storage\SessionStorage::class which would replace the $_SESSION variable with an ArrayObject an fatal error occurs then the ArrayObject is fed into ArrayUtil:merge() as that will only accept an array.

 /* @see \Zend\Session\Storage\StorageInterface */
    'session_storage' => [
        'type' => \Zend\Session\Storage\SessionStorage::class,
    ],
Argument 1 passed to Zend\Stdlib\ArrayUtils::merge() must be of the type array, object given, called in ../vendor/zendframework/zend-session/src/SessionManager.php on line 114 and defined in <b>..../vendor/zendframework/zend-stdlib/src/ArrayUtils.php

I'm using zend-session 2.5.2

@Nakira
Copy link

Nakira commented Aug 12, 2016

Had to do this : (v2.7.3 and stldlib ) 8trust@c5e523a

Had a typeError:

Fatal error: Uncaught TypeError: Argument 1 passed to Zend\Stdlib\ArrayUtils::merge() must be of the type array, object given, called in /var/www/vendor/zendframework/zend-session/src/SessionManager.php on line 136 and defined in /var/www/vendor/zendframework/zend-stdlib/src/ArrayUtils.php:269

This also worked by remove the strong typing on merge method.
I'm sure i'm missing something here, but works with my fork.

@rogatec
Copy link

rogatec commented Aug 23, 2016

I resolved it with:

'type' => \Zend\Session\Storage\ArrayStorage::class,

@exptom
Copy link
Contributor

exptom commented Sep 20, 2016

I've been having the same issue and have opened PR #57 to resolve it.

@roelvanduijnhoven
Copy link

For what it's worth, I fixed this by removing the following line from our code-base. Seems to work so far.

Container::setDefaultManager($sm->get('Zend\Session\SessionManager'));

@exptom
Copy link
Contributor

exptom commented Nov 29, 2017

zend-session v2.8.1 has just been tagged and should resolve the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants