if other script has session_start() then Container drop identity.
test at https://gist.github.com/vnagara/5365296 .
Run container.php then start-session.php then container.php again which should output 'val'
Works for zf v2.0.*
read the docs : http://zf2.readthedocs.org/en/latest/modules/zend.session.manager.html read on Session Compatibility section.
What reason it was done for? So I can't use freely third party apps with ajax query.
And for those enough:
$cwd = getcwd();
$session = new \Zend\Session\SessionManager();
You don't require load all your modules.
In my example (using CKFinder) it was some difficult to find ''/path/to/zf2-application' as I didn't know exactly which script was run by AJAX.
And there is no guaranty It won't be changed by contributor.
you should use other virtualhost to this app, so the session should be not shared with current zf app.
I agree that it would be nice if there was a better avenue for handling the sessions for these types of cases. Part of the overall issue is that items are sometimes stored in the session that are an object; if the object is stored then you more or less out of luck without starting the session from ZF.
Ultimately to be able to properly fix this issue; everything in ZF would need to ensure that it is not storing any form of objects.
This issue has been closed as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html