jeremykendall / slim-auth

Authorization and authentication for the Slim Framework using ZF2 Authentication and Acl components
MIT License
244 stars 38 forks source link

Concurrent requests in 0.0.7-alpha version #19

Open zhutik opened 9 years ago

zhutik commented 9 years ago

Hey, recently I've updated slim-auth to 0.0.7-alpha. I've checkout documentation and saw that in 0.0.7-alpha \Slim\Middleware\SessionCookie requirement was removed and instead of it, Zend\Session is used.

But I have some issues with new update when trying to run some parallel requests to server. For example: 1) First - long request to process some data. 2) Seconds request to check progress status.

In 0.0.6 second request works fine, but in 0.0.7 it waits until first request is finished. Seems like this issue is caused by blocking sessions - first request do not close session write until it finished, so second one can't access current session.

Any suggestions how I can fix it without calling session_write_close(); in application code? When I downgraded to 0.0.6 everything works perfect

Thanks!

jeremykendall commented 9 years ago

@izhutaev-sugarcrm Great catch. I'll look into that and let you know what I find.

zhutik commented 9 years ago

@jeremykendall Thanks! FYI: I'm still using Slim v2.4.2

jeremykendall commented 9 years ago

Good to know. Thanks again.

harikt commented 9 years ago

As @izhutaev-sugarcrm mentioned it seems the only way is closing the session.

If you don't need the session, may be good not to start the same.

I am looking at http://www.smartdomotik.com/2013/02/14/php-session-locks-how-to-prevent-blocking-requests/

harikt commented 9 years ago

Hm... that article seems copied from http://konrness.com/php5/how-to-prevent-blocking-php-requests/ :-/

jeremykendall commented 9 years ago

@izhutaev-sugarcrm and @harikt: I have a fix. Will try to get it posted this weekend.

harikt commented 9 years ago

:+1: