Not sure if I do something wrong, but onSessionEnd...
# lucee
h
Not sure if I do something wrong, but onSessionEnd never fires? Lucee version: 5.4.3.2 this.sessionTimeout = createTimeSpan(0,0,0,30); // also set in the Lucee Admin <cffunction name="onSessionEnd" output="false"> <cfargument name="sessionScope" type="struct" required="true"> <cfargument name="applicationScope" type="struct" required="false"> <cflog file="sessionend" text="run"> </cffunction> Nothing is getting logged?
z
what's the log level for application.log?
h
The log level is Info
Maybe a regression? I saw this issue already popped up in 2022: https://luceeserver.atlassian.net/browse/LDEV-3264
Works fine in ACF 2023
cflog is not the issue, cfdump output also doesn't work
Works fine in Lucee 4.5 too
But unfortunately not in the latest stable 5
d
@harryk There have been some issues with Lucee and logging, where it loses it's logging level. To remove that as being the issue, have you tried using fileWrite() to write to a file instead? This would verify that the problem isn't just that cflog isn't writing to the log file.
h
Yes, I tried also cfdump output without success
z
cfml or j2ee sessions?
h
j2ee sessions
Unfortunately it happens also in Lucee 6 latest snapshot - so onsessionend is broken imho in Lucee 5 latest stable and Lucee 6 latest snapshot. It works (tested) in Lucee 4.5 latest snapshot, ACF 2018, 2021, 2023 Should I reopen LDEV-3264 ?
z
no there are open tickets about this
h
Ok, do you mean https://luceeserver.atlassian.net/browse/LDEV-4166 and https://luceeserver.atlassian.net/browse/LDEV-3478 ? They could be related, but I don't use sessionInvalidate() or sessionRotate()
z
ok, had a bit more time now to look at this, so it's flagged as fixed and we have test coverag
h
Will try
z
great!
h
I saw a difference in my app settings: this.sessionType = "jee"; And in the testcase: this.sessionType="j2ee"; Maybe this is the problem already?
My setting seems to be the correct one?
z
it's just an alias, both work
are you seeing a jsessionid cookie?
h
Yes, however not sure if I understand how this test is supposed to work
z
it's creating a short lived session, then calling the purgeExpiredSessions which should then triggers the onSessionEnd, which sets a server level variable, so that the test can confirm that onSessionEnd ran
otherwise, it's a longer waiting game for the background session cleanup to run
h
I don't see purgeExpiredSessions in the code?
h
sorry, found it
z
😉
h
I tried it for almost 2h to find the differences between the test app and my app - without success. In the test app writeLog() in onsessionend works, in my app not - really crazy. So I guess the Lucee Logic works - but something in my app prevents it from running/logging. Which is really strange, because it logs in Lucee 4.5
z
what's the log level for the writeLog, default is info, the log level default is error?
h
tried it also with cffile write, so I guess writeLog is not the issue.
z
does it work with a cfml session?
h
good idea, will test!
Tested, cfml sessions don't work too. Tested with Lucee 4.5 - works
z
hmmm, if you merge your application.cfc into the test does it work?
what kind of session storage are you using?
h
i merged my code into test application.cfc and it still worked
i am using the default storage, had also tried explicitely "memory"
guess I have to give up for the moment, no ideas left
z
Is there anything in your session scope?
h
Yes, 2 variables
z
onSessionStart runs?
h
Yes, it works - tested
z
did i suggest bumping the scope log level up to debug already?
h
Not yet, but logging works in onsessionstart. Also tried cffile and dump output