Not expected ZF2 session locking during AJAX calls #4585

Closed
gecata83 opened this Issue Jun 4, 2013 · 5 comments

Projects

None yet

4 participants

@gecata83

The problem is that I'm making multiple ajax calls to a specific action on my system, these calls are making outer calls to a distant system and are waiting significant amount of time to complete and return results. On my system I am using ZF2 AuthenticationService for user authentication (saving the identity to the session). I browse trough the code and found out the different approach that ZF2 use to work with the session data, I so how the SessionManager each time write into the $_SESSION without caring does this session data is changed or not. This writing into the session global makes the session locks. In my ajax requests I need to read the data from the session but when I try to getIdentity (access the session data) the Session locks and other ajax request that needs to run asynchronously stops to wait until the Seesion unlocks. Does ZF2 has a capability to workarround this issue? How? Thank's a lot

@willy0275

I had this problem a while ago and fixed it manually with something similar to here: http://konrness.com/php5/how-to-prevent-blocking-php-requests/ ... I'm not sure if there is a zf2 way but at least there's a manual way, just in case you were not aware of it.

@gecata83

Thanks for this post it was useful, but I need ZF2 developpers include some kind of feature to the Library that stop the session writhing when is not needed. Till that moment I will write a method that would fits to me. Thanks again.

@ThaDafinser

Reference #2450

@adamlundrigan
Zend Framework member

Is this still an issue?

@gecata83 gecata83 closed this Apr 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment