Zend\Session\Container falls if other script start session #4211

Closed
vnagara opened this Issue Apr 11, 2013 · 8 comments

Projects

None yet

4 participants

Contributor
vnagara commented Apr 11, 2013

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'

Contributor
vnagara commented Apr 11, 2013

Works for zf v2.0.*

@vnagara vnagara referenced this issue in ZF-Commons/ZfcUser Apr 11, 2013
Closed

Logout after start session in separated script #284

Contributor

read the docs : http://zf2.readthedocs.org/en/latest/modules/zend.session.manager.html read on Session Compatibility section.

Contributor
vnagara commented Apr 14, 2013

What reason it was done for? So I can't use freely third party apps with ajax query.

Contributor
vnagara commented Apr 14, 2013

And for those enough:

$cwd = getcwd();
chdir('/path/to/zf2-application');
require 'init_autoloader.php';
$session = new \Zend\Session\SessionManager();
$session->start();
chdir($cwd);

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.

Contributor

you should use other virtualhost to this app, so the session should be not shared with current zf app.

Contributor
Contributor

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.

@GeeH GeeH added the To Be Closed label Mar 5, 2016
GeeH commented Jun 27, 2016

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

@GeeH GeeH closed this Jun 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment