[Logo] smithproject.org
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
Client variables not persistent if CFLOCATION is called after they are set  XML
Forum Index -> CFML, CFSCRIPT, CFC
Author Message
Cars2007



Joined: 25/01/2008 23:52:18
Messages: 20
Offline

Hi,

I have an application that does this in firstpage.cfm:

<cfapplication
name = "myapplication"
clientManagement = "Yes"
loginStorage = "cookie"
clientManagement = "Yes"
clientStorage = "cookie"
setClientCookies = "Yes"
sessionManagement = "Yes"
sessionTimeout = #CreateTimeSpan(1, 0, 0, 0)#
applicationTimeout = #CreateTimeSpan(1, 0, 0, 0)#
setDomainCookies = "Yes"
>
</cfapplication>

<CFSET client.var1 = "123">
<CFSET client.var2 = "456">
<CFLOCATION URL="nextpage.cfm">

Here's the problem. When the browser goes to nextpage.cfm, client.var1 and client.var2 are NOT set. However, if I take out the CFLOCATION tag and look at the debug output in firstpage.cfm, I can see the client variables have been set. I can go to any other page and look at the debug output and see the variables are set there as well.

So, it seems that client variables can be set, but for some reason putting a CFLOCATION immediately after that causes them to be unset.

orcus



Joined: 22/01/2007 16:10:52
Messages: 136
Offline

Hi cars,

thanks for the post. It sounds like a bug. We'll check this out.
Cars2007



Joined: 25/01/2008 23:52:18
Messages: 20
Offline

Thanks, it is a big help. To make it easier I will give you some exact code to duplicate it.

This is test1.cfm:
<cfapplication
name = "myapp"
clientManagement = "Yes"
loginStorage = "cookie"
clientManagement = "Yes"
clientStorage = "cookie"
setClientCookies = "Yes"
sessionManagement = "Yes"
sessionTimeout = #CreateTimeSpan(1, 0, 0, 0)#
applicationTimeout = #CreateTimeSpan(1, 0, 0, 0)#
setDomainCookies = "Yes"
>
</cfapplication>

<CFSET client.var1 = "variable 1">
<CFSET client.var2 = "variable 2">

<CFLOCATION URL = "test2.cfm">



This is test2.cfm:
<cfapplication
name = "myapp"
clientManagement = "Yes"
loginStorage = "cookie"
clientManagement = "Yes"
clientStorage = "cookie"
setClientCookies = "Yes"
sessionManagement = "Yes"
sessionTimeout = #CreateTimeSpan(1, 0, 0, 0)#
applicationTimeout = #CreateTimeSpan(1, 0, 0, 0)#
setDomainCookies = "Yes"
>
</cfapplication>

<cfoutput>
<pre>
Client var 1: #client.var1#
Client var 2: #client.var2#
</pre>
</cfoutput>
orcus



Joined: 22/01/2007 16:10:52
Messages: 136
Offline

Hi Cars,

thanx for the sample code! It helps a lot when people provide code to reproduce the posted bug.

It is now fixed in SVN (in SmithServlet.serviceRequest() method) and will be included in the next build.

Best regards,
orcus

 
Forum Index -> CFML, CFSCRIPT, CFC
Go to:   
Powered by JForum 2.1.6 © JForum Team