I log lifecycle calls on onSessionStart and onSessionEnd. I rotate the session when a stale CFID cookie is received from a client. But, I find that when rotated, onSessionEnd does not fire. However, the session does indeed end. If no SessionRotate() was called, then it behaves normally, and OnSessionEnd executes.
My log entries:
No SessionRotate():
“INFO”,“http-nio-8801-exec-6”,“04/28/2021”,“14:01:32”,“mpos-main-20210428001”,“onSessionStart(): Session Started; CFID=b81a11f8-e831-4975-b049-6598125b3850”
“INFO”,“Thread-1803”,“04/28/2021”,“14:06:33”,“mpos-main-20210428001”,“onSessionEnd(): Session ended; CFID=b81a11f8-e831-4975-b049-6598125b3850”
Session was rotated:
“INFO”,“http-nio-8801-exec-9”,“04/28/2021”,“14:06:48”,“mpos-main-20210428001”,“onSessionStart(): Session Started; CFID=b81a11f8-e831-4975-b049-6598125b3850”
“INFO”,“http-nio-8801-exec-9”,“04/28/2021”,“14:06:48”,“mpos-main-20210428001”,“onSessionStart(): CFID Cookie found: b81a11f8-e831-4975-b049-6598125b3850”
“INFO”,“http-nio-8801-exec-9”,“04/28/2021”,“14:06:48”,“mpos-main-20210428001”,“onSessionStart(): Session Rotated; old CFID=b81a11f8-e831-4975-b049-6598125b3850 | new CFID=04acadab-1dc7-47c6-9823-d13df18c621f”
Note, no OnSessionend log after timeout nor even waiting for some time.