Version 5 supported
This version of Silverstripe CMS is still supported though will not receive any additional features. Go to documentation for the most recent stable version.

Non-blocking file-based sessions

Make sure that your Silverstripe CMS installation has silverstripe/non-blocking-sessions installed.

The default file-based session handler for PHP holds a lock on the session file while the session is open. This means that multiple concurrent requests from the same user have to wait for one another to finish processing after a session has been started. This includes AJAX requests.

This module provides file-based session handler that is non-blocking, which means that multiple concurrent requests from the same user don't have to wait for one another to finish.

The session save handler in this module differs from the default PHP file session handler in the following ways:

  1. It doesn't lock the session file, and therefore doesn't block concurrent requests.
  2. The Session.timeout configuration property is used as the source of truth for the lifetime and garbage collection of session files.
  3. If there are problems reading or writing to session files, the default logging service is used to log them.

Note that in edge case scenarios, for example if your application wants to modify a session value based on the value that is already set and must do so for each request, non-blocking sessions may cause unexpected results.

This module is not compatible with silverstripe/hybridsessions or silverstripe/dynamodb.