cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: what happened to the global flow variables mapped to the session?
Date Thu, 16 Dec 2004 14:37:40 GMT
Sylvain Wallez wrote:
> Stefano Mazzocchi wrote:
>> I migrated an application that I wrote 18 months ago over to the 
>> latest trunk and here are the incompatible things:
>>  1) Rhino 1.6 is a lot more strict when you don't use "var" in front 
>> of a variable declaration. The previous version of Rhino was more 
>> tolerant. Not a problem but there is no back compatibility.
> This is not related to Rhino, but to the way we handle the global scope. 
> JavaScript states that if an unknown variable is used, it is attached to 
> the global scope if it's not declared with "var" and to the local scope 
> otherwise.
> The problem is that both syntaxes (with and without "var) are correct, 
> but lead to very different lifecycles of variables, especially when 
> continuations are used. I added [1] this stricter behaviour after having 
> spent half a day chasing a bug that was just a few "var" missing here 
> and there in flowscript files. Several other people reported problems on 
> the lists that were related to this implicit attachment of variables to 
> the global scope.

Gotcha! makes sense. We should really document this somewhere (I might 
wikify my experience later today).

>>  2) it used to be that in order to have global variable persist across 
>> calls even without continuations, you called cocoon.createSession() 
>> and the flow put those values in the session. Then it was removed and 
>> done automatically. Now, I can't find a way to make it work.
> ??? I'm using this daily and it works fine ???
>> So, is anybody able to persist global flow variables across 
>> non-continuated flow executions?
> Well, that *should* work...

Turns out I'm an idiot! (as usual, my day job is turning me into a 
sloppy scientist ;-)

Flow *was* persisting the variables, it was jetty that was invalidating 
the session everytime because I didn't modify the cookie path and I was 
proxy-passing it. So, when on my machine worked fine (jetty directly) 
and on the remote site it didn't (proxy-passed), I started to understand.

Sorry for the noise, folks.


View raw message