Skip to main content
Participant
May 4, 2006
Answered

Session Problem

Hi,

We are developing a site in CFMX 6 and for some reason the session variables we set are not carrying over to other pages in the site. For example, we have put the following code in each page in an attempt to figure out what is going wrong:

<cflock scope = "Session" timeout = "30" type = "Exclusive">
<cfif IsDefined("url.category")>
<cfset session.siteCategory= #url.category#>
<cfoutput>
URL Category Defined Block: URL = #url.category# <br />
Session = #session.siteCategory#
</cfoutput>
<cfelseif IsDefined("session.siteCategory")>
<cfoutput>
session is defined block #session.siteCategory#
</cfoutput>
<cfelse>
<cfset session.siteCategory= "all">
<cfoutput>
In Default Block #session.siteCategory#
</cfoutput>
</cfif>
</cflock>

This code basically says that if the session is defined, do nothing.

Each new page accessed is not reflecting the updated session variable value that was updated on a previous page. We have never had problems like this before at any other companies or any any other CF projects. If anyone has any idea what might be going wrong your reply is appreciated....

Thanks!
This topic is closed to new replies. Start a new post to keep the conversation going.
madtux2Correct answer
Participant
May 5, 2006
Problem is fixed. It appears that the browsers were caching the application.cfm and this is why the sessions were not updating correctly from page to page.

3 replies

madtux2AuthorCorrect answer
Participant
May 5, 2006
Problem is fixed. It appears that the browsers were caching the application.cfm and this is why the sessions were not updating correctly from page to page.
Translate
madtux2Author
Participant
May 5, 2006
Hi, Thanks for your reply.
Application.cfm:

<cfapplication name="myapp"
setClientCookies = "no"
sessionmanagement="Yes"
sessionTimeout = #CreateTimeSpan(0,1,20,0)#
applicationTimeout = #CreateTimeSpan(0,1,20,0)#
setDomainCookies = "no">

Both Use J2EE session variables and Enable Session Variables are checked.
Translate
Participating Frequently
May 4, 2006
What is the contents of your <cfapplication> tag in your Application.cfm in the root of your web application?

Also, are session variables enabled in the CF Administrator?
Translate