Lucee 4.5 vs Lucee 5.0 sticky sessions


#1

Hi Guys,

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?

These are the config details for lucee and Memcached on each server:

Lucee 4.x server

Version| Lucee 4.5.5.015 final
Version Name| [Neo]
Release date|Apr 9, 2018
ColdFusion® compatibilty version|10.0.0.0|

OS|Windows Server 2012 (6.2) 64bit
Servlet Container|Apache Tomcat/8.0.24
Java|1.8.0_45 (Oracle Corporation) 64bit
Architecture|64bit

Memcached driver: Available version 1.0.0.21 (Code Name: memcached)

The cache settings on this server are set the same as the details given below for the lucee 5 server, which are all defaults. The cache connection verifies ok on both servers.

Lucee 5.x server

|Version|Lucee 5.2.9.31
|Version Name|[Velvet]
|Release date|17-Sep-2018
|ColdFusion® compatibility version|2016.0.03.300357

OS|Windows Server 2012 (6.2) 64bit
Remote IP|127.0.0.1
Host Name|127.0.0.1
Servlet Container|Apache Tomcat/8.0.24
Java|1.8.0_45 (Oracle Corporation) 64bit
Architecture|64bit

Memcached driver:

Installed version|3.0.2.29
Available version|3.0.2.28, 3.0.2.25
Type|Full Version
Release Date|21-Apr-2017
Id|16FF9B13-C595-4FA7-B87DED467B7E61A0

These are the cache settings for this server:

this.cache.connections["couchbase"] = { class: 'org.lucee.extension.io.cache.memcache.MemCacheRaw' , bundleName: 'memcached.extension' , bundleVersion: '3.0.2.28' , storage: true , custom: { "socket_timeout":"30", "initial_connections":"1", "alive_check":"true", "buffer_size":"1", "max_spare_connections":"32", "storage_format":"JSON", "socket_connect_to":"3", "min_spare_connections":"1", "maint_thread_sleep":"5", "failback":"true", "max_idle_time":"600", "max_busy_time":"30", "nagle_alg":"true", "failover":"true", "servers":"172.20.69.13:39511" } , default: '' };


#2

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.