Session Variables not set

I did write two CF applications and have the same problems with both.
I use session-variables (correctly initialized in APPLICTAION.CFM)
In about 85% to 95% of the user session, the variables are set correctly; in the resting 5%-15%, session-variables stay in default value and are not set.
I already tried to set all cfset-tatements for session-variables in a <cflock>: No effect
Any Ideas?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

OK, so you've correctly enabled the use of session variables with the <CFAPPLICATION> tag in application.cfm?

SessionManagement = YES>

You said that the session variables are not being set or updated

"session-variables stay in default value and are not set"

and I've seen this before when the session variables haven't yet timed out. For example, in many applications you set a number of session variables when a user logs in to your site. You login action page will set those session variables only if the user provides a valid username and password.

Well, if they log in successfully and set the session variables, they will still have access to the site until those session variables expire on the server, even if they leave the site, return and log in again with an invalid username and password.

You can set a timespan with the <CFAPPLICATION> tag which overrides any defaults that may be set in the CF Administrator.


(0,0,30,0) means days, hours, minutes, seconds.

I'm not sure if this is similar to the situation that you are encountering, but if it's totally different, post an explanation and we'll go from there.

Good Luck,
da2121Author Commented:
Thank you for your Message; you find my application.cfm enclosed.
Unfortunately it's not that easy.
I already tried different things:
Firts, I had all cfset statements for session-variables in small pages and used cflocation at the end of the page to go to the "real" pages.
Session Variables were reproducably not set in NS 4.0x.
Then I put the cfset-statements for session-variables into the HTML.
Worked better, but not reliable.
I put all cfset statemenst in a cflock-divivsion (didn't help).
Are session-variable problematic within Framesets?

Thanks for further advise.
<cfapplication name="WebContacts"

<cfparam name="Session.PubID" default="0">
<cfparam name="Session.ThreadID" default="0">
<cfparam name="Session.MessageID" default="0">

<cfparam name="Session.ClientEmail" default="none">
<cfparam name="Session.ClientPseudonym" default="none">
<cfparam name="Session.ClientLogin" default="none">
<cfparam name="Session.ClientPasswort" default="none">
<cfparam name="session.ClientPhoto" default="noPhoto.gif">

<cfparam name="Session.ReplyerEmail" default="none">
<cfparam name="Session.ReplyerPseudonym" default="none">
<cfparam name="Session.ReplyerAnnonceStatus" default="0">
<cfparam name="Session.ReplyerAutoLogin" default="none">

<cfparam name="Session.MidiTitel" default="none">
<cfparam name="Session.MidiFile" default="none">
To answer the last part of you final comment, YES there are some issues with session variables in framesets with certain browsers. A number of threads on this topic can be found in the Forums at

To quickly summarize our experiences with this issue, many people say that starting with IE4 the problem because quite apparent. We have seen increased reliability if the IE user has install the 3725.exe patch available from Microsoft. Our experience shows that this is NOT a complete fix, especially for an Internet environment.

After many late hour discussions with a number a well respected authorities on CF, we made the determination to not use session variables as the is no known "100%" sure way of utilizing them. With this in mind, we then moved to application and client variables. Using a combination of the two, we can perform all tasks previously handled by session variables.

Good Luck,



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

da2121Author Commented:
Thanks again for your post; it's bad news to me, as I have several applications done with session variables.
Right know, I'm not quite sure how to implement the same funtionality based on application- and client-variables.
Would be very glad for some additional information; we have some real problems on one applictaion and need to find a workaround soon.



Make sure that your Netscape browser is accepting cookies.  If the CFTOKEN and CFIDE cookies are not being set, it would explain the behavior you describe.  Every time the browser requested a new document, the variables would be reset to their default values.

Tim R.

If you can tell me exactly what functionality is needed (why session vars) I will try to assist.

You can set a timeout value for client variables just as you did with session. The hardest part is removing the right client variables once the user is "logged out" of the application.

Also, as far as framesets go, one of the big problems is the CFID and CFTOKEN getting "lost" (I just love browser wars. <G>). It's always a good idea to pass the values of both these variables in any CF application to ensure that the state is maintained. They can be passed as hidden form or url vars.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.