ColdBox error after setting on a page.

Is there a way to stop this kind of error? I do not want a user to go to lunch/bathroom and then to come back and click on a link and get this kind of error.


The variable: sessionReference is undefined in the request collection (private=false)Keys Found: The error occurred in D:\apache\htdocs\ColdBox\system\web\context\RequestContext.cfc: line 721

Called from D:\apache\htdocs\ColdBox\system\web\context\RequestContext.cfc: line 135
Called from D:\apache\htdocs\AirworthinessNextGen\handlers\main.cfc: line 49
Called from D:\apache\htdocs\ColdBox\system\web\Controller.cfc: line 694
Called from D:\apache\htdocs\ColdBox\system\web\Controller.cfc: line 579
Called from D:\apache\htdocs\ColdBox\system\Coldbox.cfc: line 387

Can you post your handler and config?

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:


I have made so many changes to the site. I created a sample site so I could eliminate anything I might be doing in the code. I took the advanced ColdBox template then I generated a few cfc’s from the cfbookclub example database included in ColdFusion install. I may have messed up some of the code. I just want a simple example that works. Since this is a sample website it has everything in it. Once I get this working and get a better understanding I will post what “stupid” things I must have been doing. If I can understand what I was doing wrong.

I also would like to pass in the DSN with whatever you think is the best practices way of doing it.

Thanks for any help anyone can give me.


CBModel1.7z (139 KB)

I also would like to pass in the DSN with whatever you think is the best practices way of doing it.

You aren’t by chance calling your SessionEndHandler manually are you? You haven’t given us much information, but the only time I know of that a variable called sessionReference exists in the requestCollection (unless you are creating it) is in your session end handler, which is called automatically when the ColdFusion server calls your application.cfc’s onSessionEnd method. sessionEndHandler is configured in your configuration file. I can only assume it exists in your main.cfc handler.

If for some reason you are hitting that event directly in the browser, it wouldn’t have the sessionReference variable in the request collection like it expects.

So to reiterate, the session end event is not meant to be hit by a user in the browser (if they’re on the site, their session obviously wouldn’t be expired). It is called automatically via the app server/framework when a user’s session times out. It shouldn’t display a view-- it just can do clean up tasks/logging, etc.