Session timeout during a long running thread/request

Hi,

we have a long running cfm (> 40 minutes) and an application timeout of 30 minutes. During the run of the cfm the session expires and all variables are removed from the session variable. Is this the expected behaviour?

See this sample code (can be testet by using an application timeout of one 1 minute)

<cfsetting requesttimeout="600">
<cfscript>
session["key"] = "value";
writeDump(var=sessionstartTime(), label="Starttime-1");
writeDump(var=session.hashCode(), label="Hashcode-1");
writeDump(var=session["key"], label="Key-1");
sleep(120 * 1000);
writeDump(var=sessionstartTime(), label="Starttime-2");
writeDump(var=session.hashCode(), label="Hashcode-2");
writeDump(var=session["key"], label="Key-2"); //<---This line throws the exception with the message: key [key] doesn't exist (existing keys:)
</cfscript>

Weird thing: the session startTime and hashcode of the session object is the same,

Thanks for clarification and a great start in 2021!
Michael

you could try increasing the session MaxInactiveInterval?

https://lucee.daemonite.io/t/session-setmaxinactiveinterval-in-lucee/5853/6?u=zac_spitzer

Hi,

even if i set the maxInteractiveInterval like this the session keeps loosuing it’s content…

<cfsetting requesttimeout="600">
<cfscript>

session["key"] = "value";

writeDump(var=sessionstartTime(), label="Start-1");
writeDump(var=session.hashCode(), label="Hashcode-1");
writeDump(var=session["key"], label="Key-1");

GetPageContext().getSession().setMaxInactiveInterval( 200 * 1000 );
sleep(120 * 1000);

writeDump(var=sessionstartTime(), label="Start-2");
writeDump(var=session.hashCode(), label="Hashcode-2");
writeDump(var=session["key"], label="Key-2");
</cfscript>

i’m not sure if it’s a missunderstanding: base questions is: Why is lucee loosing it’s session content while executing a request?

Kind regards
Michael

good question, which type of sessions are you using, cf or j2ee

also, what’s your stack / versions?

Hi Zac

as Session Type we are using “application” that should be cf right?
Lucee version is 5.3.7.43

All other you can see in the screenshot attached!

Kind regards
Michael

i think there’s a tomcat option org.apache.catalina.session.StandardSession.ACTIVITY_CHECK to check for an active session request before expiring it, but I don’t think lucee enables that

bug filed

https://luceeserver.atlassian.net/browse/LDEV-3212