Link to home
Start Free TrialLog in
Avatar of da2121
da2121

asked on

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?
Thanks
Avatar of rod_nolan
rod_nolan

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

<CFAPPLICATION
ApplicationName="SomeName"
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.


<CFAPPLICATION
ApplicationName="SomeName"
SessionTimeout=
"#CreateTimeSpan(0,0,30,0)#"
SESSIONMANAGEMENT="YES">

(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,
Rod
Avatar of da2121

ASKER

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.
Eugen
=============================
<cfapplication name="WebContacts"
sessionmanagement="Yes"
sessiontimeout="#CreateTimeSpan(0,0,30,0)#">

<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">
<!---
<CFERROR TYPE="REQUEST" TEMPLATE="errorRequest.cfm" MAILTO="mail@webcontacts.ch">
<CFERROR TYPE="VALIDATION" TEMPLATE="errorValidation.cfm" MAILTO="mail@webcontacts.ch">
--->
ASKER CERTIFIED SOLUTION
Avatar of NeoSolutions
NeoSolutions

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of da2121

ASKER

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.

Thanks

Eugen
Eugen,

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.
Eugen,

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.

Tom