[SOLVED] User defined Application scope, session scope variables not in memory

I having the same problem on 5.2.7.63 and 5.2.8.50.
No retention of application or session scope variables I set in memory.

Each request executes the initialization code in Application.cfc and whatever function is called for.

New session executes onSessionStart [Application scope variables not in memory], onRequestStart
Same session executes onRequestStart [Application, Session scope variables not in memory, but automatic Session scope variables do - e.g., cfid, sessionid]

I’ve tried with Session type Application and JEE, no difference

Is there some setting in the admin that I am missing?

I have a log file and screen shot, but got message “Sorry, new users can not upload attachments.”

user defined Application and Session scope not available in template.pdf (700.3 KB)

You can see all the attachments here:
Issue

Have upgraded you to a Basic User; you should be able to upload some screenshots etc now :slight_smile:

1 Like

I was able to solve this problem by doing the following

# Lucee Server Admin: sessionType="jee"
# rewrite ACF application.cfc in several steps

* change this.xxx to xxx for all user defined variables not related to CFML, :

original code:

if (CGI.HTTPS == "on") {
	this.http	= "https://";
} else {
	this.http	= "http://";
}
this.host		= CGI.SERVER_NAME;
this.port		= CGI.SERVER_PORT;
this.base		= this.http & this.host;
this.isLocal 	= false;
switch (ucase(this.host)) {
	case "LOCALHOST":
	case "127.0.0.1":
	case "10.0.0.1":
		this.isLocal = true;
		break;
}
if (this.isLocal && this.port != "80") {
	this.base = this.base & ":" & this.port;
}

new code:

if (CGI.HTTPS == "on") {
	http	= "https://";
} else {
	http	= "http://";
}
host		= CGI.SERVER_NAME;
port		= CGI.SERVER_PORT;
base	= http & host;
isLocal 	= false;
switch (ucase(host)) {
	case "LOCALHOST":
	case "127.0.0.1":
	case "10.0.0.1":
		isLocal = true;
		break;
}
if (isLocal && port != "80") {
	base = base & ":" & port;
}

* export lucee server admin to applicationLucee.cfc

* compare settings in applicationLucee.cfc and application.cfc. remove CFML not in applicationLucee.cfc, add any missing CFML from applicationLucee.cfc,

applicationLucee.cfc

// session handling enabled or not
this.sessionManagement = true;
// cfml or jee based sessions
this.sessionType = "jee";
// untouched session lifespan
this.sessionTimeout = createTimeSpan( 0, 1, 0, 0 );
this.sessionStorage = "memory";
// client scope enabled or not
this.clientManagement = true;
this.clientTimeout = createTimeSpan( 0, 1, 0, 0 );
this.clientStorage = "memory";
// using domain cookies or not
this.setDomainCookies = false;
this.setClientCookies = false;

ACF application.cfc

this.sessionManagement = "true";
this.sessionTimeout 	= CreateTimeSpan(0,1,0,0);	//1 hours
this.loginStorage 		= "Session"; // !!! not in lucee
this.setClientCookies 	= false;
if (isLocal) {
	this.enableRobustException	= true;
	this.errorDetail				= true;
} else {
	this.enableRobustException	= false;
	this.errorDetail				= false;
}

new application.cfc

// session handling enabled or not
this.sessionManagement = true;
// cfml or jee based sessions
this.sessionType = "jee";
// untouched session lifespan
this.sessionTimeout = createTimeSpan( 0, 1, 0, 0 );
this.sessionStorage = "memory";
// client scope enabled or not
this.clientManagement = true;
this.clientTimeout = createTimeSpan( 0, 1, 0, 0 );
this.clientStorage = "memory";
// using domain cookies or not
this.setDomainCookies = false;
this.setClientCookies = false;
if (isLocal) {
	this.enableRobustException	= true;
	this.errorDetail				= true;
} else {
	this.enableRobustException	= false;
	this.errorDetail				= false;
}

* correct syntax of mappings

original code:

pathSep 	= iif(SERVER.os.name eq "UNIX",de("/"),de("\")); //Set path delimiter for client os
dir		= getDirectoryFromPath(getCurrentTemplatePath());
this.mappings["/SP"] 		= dir;
this.mappings["/SPorm"]		= dir & "externals" & pathSep & "orms";
this.mappings["/SPservices"]	= dir & "services";
if ( isMobile ) {
	this.mappings["/SPapi"]		= dir & "api";
	this.mappings["/SPmethods"]	= dir & "methods";
	this.mappings["/SPaur"]		= dir & "aur";
}

new code:
pathSep 	= iif(SERVER.os.name eq "UNIX",de("/"),de("\")); //Set path delimiter for client os
dir		= getDirectoryFromPath(getCurrentTemplatePath());
this.mappings["/SP"] 			= {physical:"#dir#"};
this.mappings["/SPorm"]			= {physical:"#dir#externals#pathSep#orms"};
this.mappings["/SPservices"]	= {physical:"#dir#services"};
if ( isMobile ) {
	this.mappings["/SPapi"]		= {physical:"#dir#api"};
	this.mappings["/SPmethods"]	= {physical:"#dir#methods"};
	this.mappings["/SPaur"]		= {physical:"#dir#aur"};
}
1 Like

Thank you, I uploaded one of the screen shots, the others too big