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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Death of session variables using NS & CF Server v5 1

Status
Not open for further replies.

josel

Programmer
Joined
Oct 16, 2001
Messages
716
Location
US
I have basically rewritten my templates and I am still in the same hole I was weeks ago 8o)

Please help me out here !!!!!!!!!!

My session variables just vanish when using NS, but have no problem when using IE ????


My application.cfm looks like this
----------------------------------------------

<CFAPPLICATION NAME=&quot;DecoDemo&quot; CLIENTMANAGEMENT=&quot;Yes&quot;
SESSIONMANAGEMENT=&quot;Yes&quot; SETCLIENTCOOKIES=&quot;No&quot;
SESSIONTIMEOUT=&quot;#CREATETIMESPAN(0,1,0,0)#&quot;
APPLICATIONTIMEOUT=&quot;#CREATETIMESPAN(2,0,0,0)#&quot;>

<cfset application.dsn=&quot;deco&quot;>
<cfset applicaiton.username=&quot;josel&quot;>
<cfset applicaiton.password=&quot;mypassword&quot;>
<cfset application.title=&quot;Deco Demo, Inc.&quot;>
<cfset application.company=&quot;Jose D. Lerebours 2001-2002&quot;>

<!--- Set directories used within CFML templates --->
<cfset application.root=&quot;/wallpaper/&quot;>
<cfset application.images=&quot;images/&quot;>
<cfset application.admin=&quot;sysAdmin/&quot;>
<cfset application.prodAdmin=&quot;prodAdmin/&quot;>
<cfset application.temp=&quot;temp/&quot;>
<cfset application.includes=&quot;includes/&quot;>
<cfset application.monthly=&quot;mthEvent/&quot;>
<cfset application.products=&quot;products/&quot;>
<cfset application.profile=&quot;profile/&quot;>

<cfset application.url=&quot;
---------------------------------------------------------

I have a simple login template that once user is validated, routes him/her to index.cfm. Index.cfm calls several templates, using cfinclude ..., within which navigations options are set based on session variables.

All options show as expected at this point GREAT! :-)

Now, click on any of these options, and they are gone :-(

All templates call same included templates to maintain a uniform format. So, the navigation options should ALWAYS appear on screen so long as my session is alive.

Now, here is the kicker, the same set of CFML pages work just fine in IE5.0.3 but not in NS <ANY VERSION>. I have removed and installed NS several times. I have even added a different WIN machine, installed NS on that machine and I still have the problem.

I am using W2K Server, CF Server 5.0 and NS 6.2 ...

Thank you all in advance;

josel If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Several things I noticed in your script.

First is first, you have several words spelled incorrectly.

<cfset application.dsn=&quot;deco&quot;>
<cfset applicaiton.username=&quot;josel&quot;>

You have 'applicaiton' instead of 'application'.

Other than that, I wasn't aware that there was an &quot;APPLICATION&quot; variable in ColdFusion. I am still fairly new to ColdFusion myself. But for Session Variables, I thought you had to use &quot;SESSION&quot; variables:

For example:

<cfset session.dsn=&quot;deco&quot;>
<cfset session.username=&quot;josel&quot;>
<cfset session.password=&quot;mypassword&quot;>
<cfset session.title=&quot;Deco Demo, Inc.&quot;>
<cfset session.company=&quot;Jose D. Lerebours 2001-2002&quot;>

I hope I helped, even if just a little. I guess another solution might be to check your Netscape Settings.
 
Hello Abe:

Thanks for pointing out the syntax! You are right, session variables do use &quot;session&quot; as prefix. I do not set session variables within 'application.cfm' but within login page once user ID and password has been validated.

The 'application.cfm', however, among many other thins, to set how session variables are treated and whether or not they would be used (see <cfapplication ...> above!).

I do use <cfset session.UserID=&quot;#UserID#&quot;> type syntax to set all session variables. I have also checked my NS settings and it is set to accept cookies. I have erased all temporary and history information and set it to look at new page everytime to make sure it is not catching ... and I still cannot pin-point the problem.

All I can say is that from login.cfm to index.cfm variables are OK, but from index.cfm to ANYPAGE.cfm variables are gone!

I will erase the above mentioned typos from my application.cfm but I do not expect this to be the root cause (that would be nice 8-) ).

Regards;

Jose Lerebours If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
How are you doing the redirection using cflocation if so is add token set to yes?

Can we see the redirection code?


Kola
 
One thing I forgot to mention whenever using shared scope variables (application, server or session) you must lock them! I dont have any info to hand but there is a wealth of articles around on this subject. When you start experiencing applications that were running fine all of sudden start throwing strange errors the first thing to check is that all shared scope variables are locked.

<cflock scope=&quot;APPLICATION&quot; type=&quot;EXCLUSIVE&quot; timeout=&quot;5&quot; >
<cfset application.dsn=&quot;deco&quot;>
<cfset applicaiton.username=&quot;josel&quot;>
<cfset applicaiton.password=&quot;mypassword&quot;>
<cfset application.title=&quot;Deco Demo, Inc.&quot;>
<cfset application.company=&quot;Jose D. Lerebours 2001-2002&quot;>

<!--- Set directories used within CFML templates --->
<cfset application.root=&quot;/wallpaper/&quot;>
<cfset application.images=&quot;images/&quot;>
<cfset application.admin=&quot;sysAdmin/&quot;>
<cfset application.prodAdmin=&quot;prodAdmin/&quot;>
<cfset application.temp=&quot;temp/&quot;>
<cfset application.includes=&quot;includes/&quot;>
<cfset application.monthly=&quot;mthEvent/&quot;>
<cfset application.products=&quot;products/&quot;>
<cfset application.profile=&quot;profile/&quot;>

<cfset application.url=&quot;</cflock>
 
Hey pigsie, thanks for the heads up on <cflock>. I made suggested changes.

However, <cflock> alone did not solve the problem 8-(

In the other hand, by changing SETCLIENTCOOKIES=&quot;NO&quot; to SETCLIENTCOOKIES=&quot;YES&quot; got it to work 8-)

I do use <cflocation ...>. I looked up addtoken argument and found that &quot;YES&quot; is the default and that it is closely related to &quot;SETCLIENTCOOKIES&quot; setting. So, I would need to ADDTOKEN if SETCLIENTCOOKIES was set to NO, but changing it to YES would make default ADDTOKEN to YES ... and I figure, that I would be better off changing my application one time one place change instead of a few dozen pages 8-)

Thank you, thank you, very very much!!!

You pointed me in the right direction. I have been drilling my skull on this for days now ... wow, what a relieve 8-) 8-) 8-)

Regards;


Jose Lerebours

If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top