ZF2 - Session dump on page change / refresh

2019-08-31 03:46发布

问题:

Last week i asked a question which is still unresolved (unfortunately). Here is the link : ZF2 empty session container between pages

I'm opening a new question today because i found more understandable clues to explain my problem.

This is very simple : Zend Framework 2 and/or PHP dump/purge my session containers on every single page load or refresh. It's even working like this with or without AJAX calls.

Whatever i do, i can't persist my session datas because all is reset permanently.

I tried many things found around the web, like :

  • Init Zend Session Manager (with and without SessionConfig)
  • Use alternative storages like memcache with Zend\Cache\Storage
  • ...

I'm looking around for a solution for more than 2 weeks now ... and i can't find anything to resolve my problem.

I really hope that some of you guys can help me.

Thx

回答1:

I finally found my solution, i was adding a Zend\Db\ResultSet to the session. I think, because this object is too huge, it overloads the session ... but this is only a supposition.

Since i replaced the ResultSet storage by an array of Mapper objects, everything works fine.

By the way, i looked around on the internet and i didn't found anything about that kind of problem.

Hope this will help.

Thanks a lot for the help, especially to @TimFountain.