article --summary
The summary
The piece walks through how PHP stores sessions in files and what happens when a write to that file is cut off partway through. Partial writes can leave session contents in a half-updated state that an attacker may be able to exploit.
The author uses this case to make a broader point about atomicity: holding a lock on a file controls who can access it at a given moment, but it does not guarantee that a multi-step update either completes fully or not at all. Readers interested in concurrency, storage design, or web security will find it a concise example to learn from.
Editorial note: This is a summary of an article first published by freek.dev. The full piece is on their site.