Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session variables not working

Status
Not open for further replies.

aarontra

Programmer
Oct 2, 2002
50
US
Something is wrong with our web and I can't figure it out.
application.cfm
Code:
<CFAPPLICATION NAME             = &quot;#ApplicationName#&quot;
               CLIENTMANAGEMENT = &quot;YES&quot;
               SESSIONMANAGEMENT = &quot;YES&quot;>

Pages that have session variables give this error:
CWebException: Error: Attempt to access a Session variable when session management is not enabled. Use the CFAPPLICATION tag to enable session management.

Note: This feature may have been disabled by the site administrator.

Explanation:


unknown error while executing a tag.

Also have gotten this error:

Request canceled or ignored by serverServer busy or unable to fulfill request. The server is unable to fulfill your request due to extremely high traffic or an unexpected internal error. Please attempt your request again (if you are repeatedly unsuccessful you should notify the site administrator). (Location Code: 26)

This was working and I am not sure how or why it is broken.

Thank you
Aaron



 
Are you sure that you dont have another application.cfm file in that folder? If so you need to include the prvious one into that one.


If not...

Do a quick test to rule out some things.

Make a new folder and add a new application.cfm file in it with nothing but the

<CFAPPLICATION NAME = &quot;#ApplicationName#&quot;
CLIENTMANAGEMENT = &quot;YES&quot;
SESSIONMANAGEMENT = &quot;YES&quot;>


and the make a page the defines a session variable. This will rule out the session setting as a problem.


David McIntosh

Have a nice day!
 
You might also make sure the file is named Application.cfm (with a cap 'A')... if it's all lowercase, some versions of ColdFusion on some platforms won't pick the file up, and it would be just like you hadn't set the CFAPPLICATION at all (which appears to be what's happening in your case).

Or it could be CFAPPLICATION has been disabled by your administrator. Do you administer the ColdFusion server? Or is this on a 3rd party ISP?
Hope it helps,
-Carl
 
I might have narrowed it down.
I have an &quot;include&quot; file that sets a session variable that will not work. (it used to work)
But the same code in a page works fine.

I have tried calling it two different ways
<cf_globalsettings>
OR
<cfinclude template=&quot;globalsettings.cfm>

globalsettings.cfm

Code:
.
.
.
<cfif isDefined(&quot;Url.Debug&quot;) >
	<cfif Url.Debug>
		<cfset Session.Debug = &quot;True&quot;>
	<cfelse>
		<cfset Session.Debug = &quot;False&quot;>
	</cfif>
	
</cfif>
.
.
.

I also tried &quot;Session.Debugx&quot; and same error.

An error occurred while evaluating the expression:


Session.Debugx = &quot;True&quot;



Error near line 35, column 9.
--------------------------------------------------------------------------------

Attempt to access a Session variable when session management is not enabled. Use the CFAPPLICATION tag to enable session management.

Note: This feature may have been disabled by the site administrator.

The error occurred while processing an element with a general identifier of (CFSET), occupying document position (35:3) to (35:33).


Date/Time: 01/07/03 16:26:42
Browser: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
Remote Address: 130.157.150.179
Query String: debugx=true


We host all our own stuff, and the admins say they didn't change anything.

I wish I knew why this just broke.

Thank you
Aaron



 
And you're sure globalsettings.cfm is actually getting included? ie - did you stick a CFOUTPUT of something at the beginning of globalsettings.cfm so there's an indication in the browser that the file is being loaded?

Also, your code:
Code:
<cfif isDefined(&quot;Url.Debug&quot;) >
    <cfif Url.Debug>
        <cfset Session.Debug = &quot;True&quot;>
    <cfelse>
        <cfset Session.Debug = &quot;False&quot;>
    </cfif>
    
</cfif>
there's no &quot;default&quot;. ie - if you don't set debug on the query string, it appears Session.Debug wouldn't get set to anything.

How 'bout, instead, something like:

Code:
<cfparam name=&quot;URL.debug&quot; default=&quot;false&quot;>
<cfset session.debug = URL.debug>


Hope it helps,
-Carl
 
Just tried what dmcintosh suggested.
And it works.

Which is good, but why is the other code broken?
well, at least now maybe I can track down the bug tommorrow.

Thank you all for your help
Aaron
 
I think I found the problem.
I had a Session variable called 'SessionID', which seems to be a cold fusion reserved word.

Here is a list of Session variables that Cold Fusion seems to use:
session.CFID
session.CFTOKEN
session.SESSIONID
session.URLTOKEN

Aaron

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top