Perhaps I'm misunderstanding, but this seems to be missing the point - the issue is the block above, which recommends DB sessions if
DbHelper::isInstalled(), regardless of whether it is already in use. 😅
The error reported occurred when I had dbfile enabled (by default) but the 'data?' preceding the Base64 serialized representation in the data row had been removed. The actual error message below the "try using the database session handler" block correctly identified a corrupted session in the database, and reported that it had deleted the session in question.