coldfusion -Element CFID is undefined in SESSION

Posted on 2011-05-10
Last Modified: 2012-08-13
Hello experts
I'm trying the code from this tutorial: but i get the error:Element CFID is undefined in SESSION

Any help?
  <cfparam name="" type="string" default="" />
	<cfif (ListLen( ) LT 5)>
		<cfset = ListAppend(,"#SESSION.CFID#-#SESSION.CFTOKEN#")>
		<cflocation url="#CGI.script_name#?" addtoken="false"/>
    <cfset arrID = ListToArray( ) />
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
		<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
			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

Question by:Panos
    LVL 51

    Expert Comment

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

    LVL 2

    Author Comment

    Hi agx.
    This is a part of my application.cfm
          applicationtimeout="#CreateTimeSpan( 0, 1, 0, 0 )#"
    LVL 51

    Accepted Solution

    Then you're probably using J2EE session variables which uses sessionid not CFID and CFTOKEN.  
    LVL 51

    Expert Comment

    I haven't read the whole article. But I'm guessing it should work if you change this
    <cfset = ListAppend(,"#SESSION.CFID#-#SESSION.CFTOKEN#")>

    ... to
    <cfset = ListAppend(,"#SESSION.sessionid#")>
    LVL 2

    Author Comment

    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

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
    PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now