I just updated to the new version and this exception was displayed.

Stack Trace:

Fatal error: Uncaught exception 'Zend\Session\Exception\RuntimeException'
with message 'Container cannot write to storage due to type mismatch' in
G:\virtual_host\dektacms\dk-library\Zend\Session\AbstractContainer.php:202
Stack trace: #0
G:\virtual_host\dektacms\dk-library\Zend\Session\AbstractContainer.php(404):
Zend\Session\AbstractContainer->verifyNamespace(false) #1
G:\virtual_host\dektacms\dk-library\Zend\Stdlib\ArrayObject.php(82):
Zend\Session\AbstractContainer->offsetExists('identityData') #2
G:\virtual_host\dektacms\dk-library\Zend\Authentication\Storage\Session.php(93):
Zend\Stdlib\ArrayObject->__isset('identityData') #3
G:\virtual_host\dektacms\dk-library\Zend\Authentication\AuthenticationService.php(134):
Zend\Authentication\Storage\Session->isEmpty() #4
G:\virtual_host\dektacms\dk-library\Dekta\Application.php(136):
Zend\Authentication\AuthenticationService->hasIdentity() #5 [internal
function]: Dekta\Application::Dekta\{closure}(Object(Zend\Mvc\MvcEvent)) #6
G:\virtual_host\dektacms\dk-library\Zend\EventMana in
G:\virtual_host\dektacms\dk-library\Zend\Session\AbstractContainer.php on
line 202

This is my code, it was working in 2.1.0 version:

$authentication = new AuthenticationService();
$sessionManager = new SessionManager();
$sessionManager->setName('sess_cookie');
$authentication->setStorage(new Storage\Session('My', 'identityData',
$sessionManager));
            
$userModel = $serviceManager->get('Dekta\Permissions\UserModel');
            
if ($authentication->hasIdentity()) 
{
    $user = $userModel->getUserById($authentication->getIdentity()->userId);
}

Anyone has an idea to fix this error?
Thanks.



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/zf2-2-1-1-Container-cannot-write-to-storage-due-to-type-mismatch-tp4659065.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to