Re:Race conditions on the web
by dspillett on Wednesday July 13, 2016 @04:56AM
(#12084862)
That isn't so much a race condition as session/state corruption. The designer hasn't considered that their chosen state store in this instance is not entirely private so two instances of their code can clobber each other's global state.
A common occurrence of this I've seen in many places (including some of our old code years ago) is using a cookie to store simple client-side choices that you want to persist between requests, for instance the tab that was selected when you were last on a complex page, or some other temporary preference, or as in your example breadcrumbs for navigation.
This falls over as soon as the user has two tabs/windows open because (unless the window is explicitly opened with a different session i.e. in private mode, with File/NewSession in IE, or such) the cookies (even temporary session level ones) are a shared resource. It isn't a big issue usually as more often than not it only concerns superficial UI matters (those that are "nice to have"s rather than breaking something essential), but I can imagine circumstances where the problem could open more serious problems.
A common occurrence of this I've seen in many places (including some of our old code years ago) is using a cookie to store simple client-side choices that you want to persist between requests, for instance the tab that was selected when you were last on a complex page, or some other temporary preference, or as in your example breadcrumbs for navigation.
This falls over as soon as the user has two tabs/windows open because (unless the window is explicitly opened with a different session i.e. in private mode, with File/NewSession in IE, or such) the cookies (even temporary session level ones) are a shared resource. It isn't a big issue usually as more often than not it only concerns superficial UI matters (those that are "nice to have"s rather than breaking something essential), but I can imagine circumstances where the problem could open more serious problems.