We have been working on upgrading Lucee 4.x to 5.x. We started by upgrading one of our 3 load balanced servers in our pool to Lucee 5.x and bought it back into the pool. All was working fine, but we realised that sticky CF sessions using the Memcached driver with Couchbase were being lost when a user is moved from a Lucee 4.x to 5.x server or vice versa. Still works fine if a user is moved from one 4.x server to the other.

Is there anything obvious between 4.x and 5.x which would cause issues in maintaining the sessions that we may not be aware of? Would this be a known incompatibility and we should expect to loose sessions?

Lucee 4 and 5 have significantly different implementations of the session cache serialization which is not compatible so far as I know. You’ll likely have issues trying to use session caching with side-by-side major versions of Lucee. In fact, Lucee has been known to change it between minor versions which can render the serialized objects in cache unusable.

What Ortus has done is stopped using the full-fledged session storage in many cases, and moved to using our cbstorages module for Coldbox to store all Session variables. Then we control the serialization mechanism and can upgrade Lucee without it being affected.