Private Session Zend Auth

I'm almost disappointed with how Zend processing works.

here is my case. I am writing an auth plugin that always validates user credentials using Zend_Auth. and when calling the hasIdentity function from zend auth it will automatically start the session.

and the problem arises when I have a lengthy process that I need to execute. The session blocks the request until the request completes. I am trying to release the lock by calling Zend_Session :: writeClose (false) so that another request can be made. but not for me to start the session again.

Is this a bad implementation if I try to resume a stop session?

Is there only one session from the very beginning until the query completes?

thank.

ps: I can hack a bit here. at the end of the auth plugin, I will write the built-in php function (session_write_close), and if any controller needs to use the session again, I started it again (session_start).

+3
source share
1 answer

The easiest solution to this problem is to use a database to store sessions. There are no file locks to worry about (as ArneRie explained).

Option 1

Use the common PHP extension and tiny tweak for php.ini:

NFS session_set_save_handler, , , SQL. , , , , memcached...

: http://www.dotdeb.org/2008/08/25/storing-your-php-sessions-using-memcached/

2

Zend, Zend_Session_SaveHandler_DbTable.

: Zend -

+1

Source: https://habr.com/ru/post/1765826/


All Articles