In my Application.cfc::onSessionStart(), I copy old session data from a Mongo cache and then append it to the newly created session. Then I rotate the session since the client usually has old cfid cookies which I want refreshed.
The newly copied session data appears in the request since I dump the session in OnRequestStart(). However, on the next request, it creates a new session even though the next request had the same cfid cookies it got from onSessionStart(). I changed this unworking code:
... //cacheGet() etc...
structAppend(session, local.sessionScope, true);
sessionRotate();
// If I sessionRotate(), then I must recopy local.sessionScope over...
// NO: this still does not work! structAppend(session, local.sessionScope, true);
to manually copy the variables between my old session struct with the new, actual session struct, and it works across any series of requests:
... //cacheGet() etc...
sessionRotate();
for (k in local.sessionScope) {
session[k] = local.sessionScope[k];
}
Is there something different about how structAppend() interacts with the in-built session scope??
OS: Linux
Java Version: Oracle JDK 11.07
Tomcat Version: 9.0.35
Lucee Version: Lucee 5.3.6.61