Issues

ZF2-141: AJAX-ready sessions

Issue Type: Improvement Created: 2012-01-14T15:30:31.000+0000 Last Updated: 2012-10-08T20:15:34.000+0000 Status: Closed Fix version(s): Reporter: Mehran Ziadloo (mehran) Assignee: Ralph Schindler (ralph) Tags: - Zend\Session

  • condition
  • race
  • session

Related issues: Attachments:

Description

Due to asynchronous nature of AJAX requests, it's probable for two requests of same client race each other for a session data. ZendFramework has already included the prefect implementation for JSON-RPC and XML-RPC servers. Any RPC server is useless without exclusive access to session data. I believe the following functionalities is what is missing right now in Zend_Session and/or Zend/Session classes:

  • Exclusive inter-request access to each session namespace.
  • Specifying the access type prior loading a namespace. Access types include: read-only, read & write. And for namespaces loaded as read-only, changing any part of session should throw an exception. I believe that it's obvious that read-only accesses share their locks while read & write accesses hold an exclusive one.

Suggestions for implementation: One can save each namespace in different file and lock it using flock when sessions are to be saved as files. As for the sessions in database, the database engine should lock the namespace record which MySQL supports.

Please let me know if I can be of any help. I'll be glad to know if my proposal is feasible or not.

Regards, Mehran Ziadloo

Comments

Posted by Ralph Schindler (ralph) on 2012-10-08T20:15:34.000+0000

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2450

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts