• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1412
  • Last Modified:

coldfusion -Element CFID is undefined in SESSION

Hello experts
I'm trying the code from this tutorial:http://www.bennadel.com/blog/730-Testing-ColdFusion-Session-Cookie-Acceptance.htm but i get the error:Element CFID is undefined in SESSION

Any help?
  <cfparam name="URL.id" type="string" default="" />
	<cfif (ListLen( URL.id ) LT 5)>
		<cfset URL.id = ListAppend(URL.id,"#SESSION.CFID#-#SESSION.CFTOKEN#")>
		<cflocation url="#CGI.script_name#?id=#URL.id#" addtoken="false"/>
    <cfset arrID = ListToArray( URL.id ) />
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<title>ColdFusion Session Cookie Test</title>
		<style type="text/css">
			p.confirm {
				background-color: ##F9FBFF ;
				border: 2px solid ##6699FF ;
				font-size: 28px ;
				padding: 20px 0px 20px 0px ;
				text-align: center ;
			ColdFusion Session Cookie Test
			In order for you to be able to log into
			this site, you must have Cookies enabled in
			your browser. If cookies are enabled, the
			following 5 values will be identical:
			<!--- Loop over values and output them. --->
					#arrID[ intI ]#
		<p class="confirm">
			<strong>Cookies Accepted:</strong>
				We will know that the session cookie
				information held from request to request
				if all the values in the list are identical.
				Check each value against the next.
				(arrID[ 1 ] EQ arrID[ 2 ]) AND
				(arrID[ 2 ] EQ arrID[ 3 ]) AND
				(arrID[ 3 ] EQ arrID[ 4 ]) AND
				(arrID[ 4 ] EQ arrID[ 5 ])
			If your cookies are not being accepted, please
			copy and paste the contents of this page into an
			email and send it to nikki@girls-like-girls.com.
			Output some browser related information that
			might help the tech team debug just what is
			going on.
			Browser Information
			<strong>User Agent:</strong><br />
			<strong>Request Cookies:</strong><br />
				When outputting the browser's cookie, just
				try to replace out references to CFIDE and
				ADMINISTRATOR (if they are there) so people
				don't get any funny ideas.
			#ToString( CGI.http_cookie ).ReplaceAll(

Open in new window

  • 3
  • 2
1 Solution
Sounds like you haven't enabled session variables or there's no Application.cfc/cfm file in that script's path.

PanosAuthor Commented:
Hi agx.
This is a part of my application.cfm
      applicationtimeout="#CreateTimeSpan( 0, 1, 0, 0 )#"
Then you're probably using J2EE session variables which uses sessionid not CFID and CFTOKEN.  
I haven't read the whole article. But I'm guessing it should work if you change this
<cfset URL.id = ListAppend(URL.id,"#SESSION.CFID#-#SESSION.CFTOKEN#")>

... to
<cfset URL.id = ListAppend(URL.id,"#SESSION.sessionid#")>
PanosAuthor Commented:
Yes agx.
The problem was the J2EE session. I did check this in the coldfusion admin and than forgot to uncheck it.
Thank you.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now