You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2004/09/11 17:45:26 UTC

Flow without session, how?

Sounds like a simple question but I haven't found the answer in the 
lists:  Is it possible to prevent Flowscript from creating a session?

I have some pages in my app that don't need state and the sessions get 
in the way of automated (torture;-) testing.

-Bertrand


Re: Flow without session, how?

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 12 sept. 04, à 10:22, Sylvain Wallez a écrit :

> http://devedge.netscape.com/library/manuals/2000/javascript/1.5/ 
> reference/stmt.html#1066604

Mucho thanks - I have added this to the FAQs at  
http://wiki.apache.org/cocoon/FAQs

-Bertrand


Re: Flow without session, how?

Posted by Sylvain Wallez <sy...@apache.org>.
Bertrand Delacretaz wrote:

> Le 11 sept. 04, à 20:00, Sylvain Wallez a écrit :
>
>> ...Do you have any global variables in your flowscripts? 
>> FOM_JavaScriptInterpeter creates a session (if it doesn't already 
>> exist) whenever a variable is set in the global scope.
>
>
> Ok, I see - the problem is my lack of understanding of Javascript ;-)
>
> This causes a session to be created:
>
> function public_XXX() {
>   rt = "dummy";    // huh - is that a global?
>   cocoon.sendPage("RRR");
> }
>
> Whereas this does not:
>
> function public_XXX() {
>   var rt = "dummy";
>   cocoon.sendPage("RRR");
> }
>
> Guess I'l have to go back to reading the javascript spec ;-)


Yup :-)

http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/ident.html#1009822
http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/stmt.html#1066604

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Re: Flow without session, how?

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 11 sept. 04, à 20:00, Sylvain Wallez a écrit :

> ...Do you have any global variables in your flowscripts? 
> FOM_JavaScriptInterpeter creates a session (if it doesn't already 
> exist) whenever a variable is set in the global scope.

Ok, I see - the problem is my lack of understanding of Javascript ;-)

This causes a session to be created:

function public_XXX() {
   rt = "dummy";	// huh - is that a global?
   cocoon.sendPage("RRR");
}

Whereas this does not:

function public_XXX() {
   var rt = "dummy";
   cocoon.sendPage("RRR");
}

Guess I'l have to go back to reading the javascript spec ;-)

Thanks for the hint!
-Bertrand




Re: Flow without session, how?

Posted by Sylvain Wallez <sy...@apache.org>.
Bertrand Delacretaz wrote:

> Sounds like a simple question but I haven't found the answer in the 
> lists:  Is it possible to prevent Flowscript from creating a session?
>
> I have some pages in my app that don't need state and the sessions get 
> in the way of automated (torture;-) testing.


Do you have any global variables in your flowscripts? 
FOM_JavaScriptInterpeter creates a session (if it doesn't already exist) 
whenever a variable is set in the global scope.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }