tracker issue : CF-4171125

select a category, or use search below
(searches all categories and all time range)

Session and Application scopes unavailable in REST service endpoint that returns void

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Johnny O / Johnny O (Johnny O)

Created: 07/07/2016

Components: REST Services

Versions: 10.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Win All

Vote Count: 1

Problem Description:

After upgrading to ColdFusion 10 Update 20, REST services where the endpoint returns void no longer has access to Session and Application scopes.  I believe this problem started with Update 14.  Update 13 works fine.

Steps to Reproduce:

1) Upgrade to ColdFusion Update 20.
2) Create the following endpoint:

    <cffunction name="check" access="remote" httpmethod="GET" produces="application/json" restpath="check" returntype="void">
        <cfset var foo = StructKeyExists(Session, "UserContext") />

3) Call the newly created endpoint. e.g.:

GET /rest/v1.0/widgets/check HTTP/1.1

4) Inspect the results:

HTTP/1.1 500 [coldfusion.runtime.UndefinedVariableException : Variable SESSION is undefined.]
Server: Microsoft-IIS/10.0
server-error: true
X-Powered-By: ASP.NET
Date: Thu, 07 Jul 2016 22:09:56 GMT
Content-Length: 0

Actual Result:

500 error because Session scope is unavailable.

Expected Result:

Session (and Application) scope to be available.

Any Workarounds:

The only workaround is to set the returntype to something other than void (e.g. struct or string), but then RestSetResponse stops working, as RestSetResponse requires a returntype of 'void' for it to work.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4171125

External Customer Info:
External Company:  
External Customer Name: Johnny O
External Customer Email:  
External Test Config: My Hardware and Environment details:

Windows 10, Intel i7 processor, ColdFusion 10.



I have encountered this as well, hopefully it can be fixed.
Vote by External U.
2213 | July 07, 2016 04:56:11 PM GMT
This bug is marked fixed and now closed. Which update was this fixed in?
Comment by External U.
2211 | October 24, 2016 08:17:14 AM GMT
This would be available in the next update of ColdFusion10
Comment by HariKrishna K.
2212 | October 25, 2016 09:06:08 AM GMT