0
votes

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
Can't help you a lot, but this has something to do with the way you configure your server. - Sam
Thx Sam. I'm not sure it comes from the server. Cause i get the same behavior either on my local machine (Mac OS X) and on my distant server (Ubuntu Server). - kevin.jalais
Can you see the sessions being created (i.e. can you see data in the session file/session db table)? Does this happen just for you or all users? What session timeout are you using? Without any new info, perhaps you could zip up the minimum amount of code required to repeat the problem for us to download so we can try it out? - Tim Fountain
@TimFountain, thx for your answer. Yes i can see data in session file and it happens for all users. The session timeout is set on 30 minutes ... so i don't think it comes from here. If you have a bitbucket account i can give an access to a repo with code to reproduce, tell me what you think about it. - kevin.jalais
My bitbucket username is tfountain - Tim Fountain

1 Answers

0
votes

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.