3 ms·
The article doesn't mention why versioning was used instead of just storing the cookie string in shared memory. Something about atomicity, perhaps? i.e. you can
by camtarn 2y ago
The article doesn't mention why versioning was used instead of just storing the cookie string in shared memory. Something about atomicity, perhaps? i.e. you can't guarantee that a string is updated atomically without synchronisation, so synchronisation would be needed, which could cause blocking or cause requests to queue; whereas a simple version number can be written and read atomically?
- saagarjha 2y agoMaybe because cookies can be of arbitrary size and you don’t want to keep them around all the time?
- gary_0 2y agoProbably security, too: cookie data is security-critical, since you can use it for session hijacking, etc. The version doesn't leak anything about the cookie's contents so it can be directly accessed without any security checks. The whole point of isolating the process running each website from other browser resources (like cookies) is an added layer of security.