Commit feea8fc
committed
fix: prevent session_start() lock errors with Memcached handler
Fixes #7604
When using Memcached as session handler with concurrent AJAX requests,
session_start() could throw 'Unable to clear session lock record' warning.
Two issues contributed:
1. MemcachedHandler::close() did not reset $this->lockKey and $this->lock
after deleting the lock, unlike releaseLock(). This could leave PHP's
session handler in an inconsistent lock state between requests.
2. PHP has a known limitation with custom session handlers where lock
cleanup warnings can occur during concurrent access. Using error
suppression on session_start() prevents these from becoming fatal
errors in production.
Changes:
- MemcachedHandler::close(): reset lockKey and lock after delete
- Session::startSession(): add @ to session_start() with explanatory
comment about PHP's custom session handler limitation
Note: RedisHandler and DatabaseHandler already properly managed lock
state in their close() methods.
Ref: #76041 parent 2a1c348 commit feea8fc
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
625 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
626 | 629 | | |
627 | 630 | | |
628 | 631 | | |
| |||
0 commit comments