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:
- It doesn't lock the session file, and therefore doesn't block concurrent requests.
- The
Session.timeout
configuration property is used as the source of truth for the lifetime and garbage collection of session files. - 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
.