Issues
- User defined Application scope, session scope variables not in memory for templatesLDEV-1927
- Gateway Context Cannot Use MappingsLDEV-1712Resolved issue: LDEV-1712Igal Sapir
- isInstanceOf Performance DegradationLDEV-1399Resolved issue: LDEV-1399Michael Offner
- Lucene index updates not reflected on other Lucee servers.LDEV-1166Michael Offner
- cfstoredproc fails with parameters when called by synonym which contains #LDEV-1147Resolved issue: LDEV-1147Igal Sapir
- <cfpdf> tag throwing an error when action is set to "protect"LDEV-1038Resolved issue: LDEV-1038Michael Offner
- Having EHCache Defined Slows the Process of stopping the service in WindowsLDEV-1010Resolved issue: LDEV-1010Michael Offner
- Ability to keep connection state on http/s callsLDEV-1000Resolved issue: LDEV-1000Michael Offner
- CFApplication "update" action overwrites clustered session dataLDEV-855Resolved issue: LDEV-855Michael Offner
- https does not work for extensions downloadLDEV-783Resolved issue: LDEV-783Igal Sapir
- Emails with attachments should be multipart/mixed but appear to be multipart/relatedLDEV-770Resolved issue: LDEV-770Igal Sapir
- IIFE - Inline closures do not executeLDEV-373Resolved issue: LDEV-373Pothys - MitrahSoft
- Admin assets broken when deployed as a war with a contextLDEV-331Resolved issue: LDEV-331Michael Offner
13 of 13
User defined Application scope, session scope variables not in memory for templates
Details
Assignee
UnassignedUnassignedReporter
Martie HenryMartie HenryNew Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
Martie Henry
Martie HenryNew Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Priority
Created 23 July 2018 at 16:41
Updated 9 September 2019 at 13:48
Activity
Show:
Martie Henry24 July 2018 at 13:26Edited
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, <snips>:
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, <snips>
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"}; }
I having the same 2 problems on 5.2.7.63 and 5.2.8.50.
1 - onApplicationStart does not execute (solved with code in onSessionStart)
2 - user defined variables in Application and Session scope are not defined in templates
Session storage is set to memory
I do not see a comparable setting in lucee to acf enable application variables, enable session variables
Each request executes the initialization code in Application.cfc and whatever function is called for.
a - unmodified code for new session executes
initialization code is executed [ this.xxx ]
onApplicationStart is NOT executed
onSessionStart [ user defined Application scope variables not in memory] - error
b - modified onSessionStart code to run onApplicationStart
/* onApplicationStart not running */ if ( ! structKeyExists(application,"appCode") ) { WriteLog( text="start code execute onApplicationStart if user variables not in scope", type="information", application="true", file="Testing" ); onApplicationStart(); WriteLog( text="end code execute onApplicationStart if user variables not in scope", type="information", application="true", file="Testing" ); }
c - modified code for new session
initialization code is executed [ this.xxx ]
onSessionStart [ user defined Application scope variables not in memory]
code executes onApplicationStart
continue onSessionStart [ user defined Application scope variables in memory]
onRequestStart [ user defined Application and Session scope variables in memory]
template [ user defined Application and Session scope variables not in memory , Standard Session scope variables are in memory - e.g., cfid, sessionid ] - error
d - modified code for same session executes
initialization code is executed [ this.xxx ]
onRequestStart [ user defined Application and Session scope variables in memory]
template [ user defined Application and Session scope variables not in memory , Standard Session scope variables are in memory - e.g., cfid, sessionid ] - error
I’ve tried with Session type Application and JEE, no difference