Copy link to clipboard
Copied
Hi i got error
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
my cfapplication tag looks like this
<cfapplication name="project"
sessionmanagement="Yes"
setclientcookies="Yes"
applicationtimeout="#CreateTimeSpan(0,0,0,0)#">
Copy link to clipboard
Copied
<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
Copy link to clipboard
Copied
<cfapplication name="project"
sessionmanagement="Yes"
setclientcookies="Yes"
applicationtimeout="#CreateTimeSpan(0,0,0,0)#">
What are your session timeout settings in CFAdmin?
--
Adam
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
applicationtimeout="#CreateTimeSpan(1,0,0,0)#"
That is, give the application a finite timeout before you proceed any further.
Copy link to clipboard
Copied
when i changed the application timeout variable, still getting the same error.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
this is application that is migrated from cf5 to cf8 . so i think is there any problem from this migration?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Start with the basics. cfdump your session scope. What do you see?
Copy link to clipboard
Copied
when i dumped this i got these values
struct | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
allowedcals | [empty string] | ||||||||||||||||||||||||||||||||||
apphome | /IDSco/projects/sales_plans/ | ||||||||||||||||||||||||||||||||||
cookietrail |
| ||||||||||||||||||||||||||||||||||
logininfo |
| ||||||||||||||||||||||||||||||||||
proginfo |
| ||||||||||||||||||||||||||||||||||
sessionid | PlwobBV8Pc-dq8InyYr8ImX | ||||||||||||||||||||||||||||||||||
urltoken | CFID=385&CFTOKEN=7aca5a73d50e1316-74A491A4-B665-D95E-7BE2EAA20A431D81&jsessionid=PlwobBV8Pc-dq8InyYr8ImX |
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
<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>
Copy link to clipboard
Copied
no it does not works if i removed locks, still getting errorwhen i removed locks
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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