Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Element CFID is undefined in SESSION.

New Here ,
Jun 11, 2009 Jun 11, 2009

Hi i got error

Element CFID is undefined in SESSION.

i had a file test.cfm and in this i hada session logic as

<cflock scope="session" timeout="10">
    <cfset myURLToken = session.URLToken />
</cflock>

<cfoutput><cflock scope="session" timeout="10">
    <input type="hidden" name="CFID" value="#session.CFID#" />
    <input type="hidden" name="cftoken" value="#session.cftoken#" />
</cflock></cfoutput>

but when i try to run thepage i am getting error . Please help me how  to solve this error .

Thanks.

TOPICS
Getting started , Security
15.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 12, 2009 Jun 12, 2009

I've seen this happen when you do a StructClear(Session). If that's

not it then we need more info: does it happen with a simple

Application.cfm file, what does your cfapplication tag look like, etc.

Mack

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

my cfapplication tag looks like this

<cfapplication name="project"
               sessionmanagement="Yes"
               setclientcookies="Yes"
               applicationtimeout="#CreateTimeSpan(0,0,0,0)#">

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 11, 2009 Sep 11, 2009

<cfapplication name="project"
               sessionmanagement="Yes"
               setclientcookies="Yes"
               applicationtimeout="#CreateTimeSpan(0,0,0,0)#">

That's a rather low application timeout you've got there.  Do you mean to be setting it to zero?

(I can't see how this would impact your sessions, having said that)

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 11, 2009 Sep 11, 2009

<cfapplication name="project"
               sessionmanagement="Yes"
               setclientcookies="Yes"
               applicationtimeout="#CreateTimeSpan(0,0,0,0)#">

What are your session timeout settings in CFAdmin?

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

i changed code as this

<cfoutput><cflock scope="session" timeout="10">
    <input type="hidden" name="sessionid" value="#session.sessionid#" />
     <input type="hidden" name="cftoken" value="#session.cftoken#" />
</cflock></cfoutput>

now i am getting errror as

Element CFTOKEN is undefined in SESSION.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 11, 2009 Sep 11, 2009

applicationtimeout="#CreateTimeSpan(1,0,0,0)#"

That is, give the application a finite timeout before you proceed any further.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

when i changed the application timeout variable, still getting the same error.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

my debug output is like this

Cookie Variables:

CFID=3
CFTOKEN=7aca5a73d50e1316-74A491A4-B665-D95E-7BE2EAA20A431D81
CMS_ZIPCODE=45245
IDISRESET=
JSESSIONID=0000icCbz4Db5piBVE7TMlG:-1
rememberval=YES
s_lastvisit=1252076345353
s_vi=[CS]v1|254974EE85010F05-40000104A0006ABD[CE]


Session Variables:
allowedcals=
apphome=/IDSco/projects/sales_plans/
cookietrail=Array (2)
logininfo=Struct (6)
proginfo=Struct (16)
sessionid=icCbz4vMPJDb5piBVE7TMlG
urltoken=CFID=385&CFTOKEN=7aca5a73d50e1316-74A481&jsessionid=icCbz4vMPJDb5p
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

this is application that is migrated from cf5 to cf8 . so i think is there any problem from this migration?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 11, 2009 Sep 11, 2009

this is application that is migrated from cf5 to cf8 . so i think is there any problem from this migration?

Well you can get rid of all the <cflock> tags around most reads/writes to shared scope variables now, anyhow.  It won't impact your problem, but it will impact your application's performance (for the better).

Does this error happen all the time for all accesses to session.CFID, or just sometimes, or what?  Is anything else going missing from the session?

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

i dont know exactly, because this is my support issue working now and i need to fix this asap.

I have no idea how  to fix this

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 11, 2009 Sep 11, 2009

Start with the basics.  cfdump your session scope.  What do you see?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

when i dumped this i got these values

struct
allowedcals[empty string]
apphome/IDSco/projects/sales_plans/
cookietrail
array
1
struct
PAGE/IDSco/projects/sales_plans/index.cfm
QSTRINGCFID=385&CFTOKEN=7aca5a73d50e1316-74A491A4-B665-D95E-7BE2EAA20A431D81&JSESSIONID=PlwobBV8Pc-dq8InyYr8ImX
TITLEMain
2
struct
PAGE/IDSco/projects/sales_plans/sales_plan/frm_add.cfm
QSTRING[empty string]
TITLEUpload Plan
logininfo
struct
ACCESSLEVEL1
EMPNOcsc5557
FIRSTNAMEKIRAN
LASTNAMEPULIGADDA
USERIDCSC5557
USERNAMECSC5557
proginfo
struct
ASSIGNEDDIV
ASSIGNEDSTORE[empty string]
ASSIGNEDZONE[empty string]
NDPROJNAMTX/projects/sales_plans/
NDPROJSTRPGTXindex.cfm
PRODCD00
PROGLANGCDCF
REQUESTEDPROGNO666720
REQUESTEDQUERYSTRING[empty string]
REQUESTEDREFERER[empty string]
REQUESTEDSCRIPTNAME[empty string]
STORERIGHTS3
USERPASSCSC5557
USERPRIVS[empty string]
progno666720
refpageapp_cats_list.cfm
sessionidPlwobBV8Pc-dq8InyYr8ImX
urltokenCFID=385&CFTOKEN=7aca5a73d50e1316-74A491A4-B665-D95E-7BE2EAA20A431D81&jsessionid=PlwobBV8Pc-dq8InyYr8ImX

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 11, 2009 Sep 11, 2009

A quick workaround is to use list functions on session.urltoken.  You have to treat it as a nested list.  The outer delimiters is & and the inner is =.

The rest is beyond my level on knowlege.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

when i changed this code to this code it is working, is this way is correct or i am making any mistake.

<cfoutput><cflock scope="session" timeout="10">
    <input type="hidden" name="CFID" value="#session.sessionid#" />
     <input type="hidden" name="cftoken" value="#cookie.cftoken#" />
</cflock></cfoutput>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 11, 2009 Sep 11, 2009

<cflock scope="session" timeout="10">
    <cfset myURLToken = session.URLToken />
</cflock>

<cfoutput><cflock scope="session" timeout="10">
    <input type="hidden" name="CFID" value="#session.CFID#" />
    <input type="hidden" name="cftoken" value="#session.cftoken#" />
</cflock></cfoutput>

Now, drop the locks. You don't need them in CF8, at least, not as they're applied here. Do instead


    <cfset myURLToken = session.URLToken />


   <cfoutput> <input type="hidden" name="CFID" value="#session.CFID#" />
    <input type="hidden" name="cftoken" value="#session.cftoken#" /></cfoutput>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

no it does not works if i removed locks, still getting errorwhen i removed locks

Element CFID is undefined in SESSION

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 11, 2009 Sep 11, 2009

Navigate to the page Server Settings => Memory Variablesin the Coldfusion Administrator. Uncheck the option and check the options Enable Application Variables and Enable Session Variables. Click the button to submit the changes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 11, 2009 Sep 11, 2009
LATEST

Navigate to the page Server Settings => Memory Variablesin the Coldfusion Administrator. Uncheck the option and check the options Enable Application Variables and Enable Session Variables. Click the button to submit the changes.

Hah!  Well spotted.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources