cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Problem with losing session context 'authentication' - looking fo r workaround or bugfix
Date Tue, 11 May 2004 22:22:18 GMT

Can someone please help me in finding either a workaround or a bugfix to the
following problem:

I loose the 'authentication' context in the session when I go from one
"protected" page to the next "protected" page when I access it directly
(i.e. by it's internal url).

In detail:

- default Cocoon root sitemap with automounted subsitemap of my app. 
- authentication-fw setup like the sample with the flowscripts (auth.js).
- all "public" urls go through the "protect" function to their "internal"
- all internal/*.html urls go to an appropriate javascript function
- all internal/*.form urls generate a form:

<map:match pattern="**/internal/*.form">
    <map:generate type="jx" src="content/{2}Template.jx"/>
    <map:transform type="cinclude"/>
    <map:transform type="forms"/>
    <map:transform src="stylesheets/resources/forms-samples-styling.xsl">
	  <map:parameter name="uri" value="stylesheets/resources"/>
    <map:call resource="html-layout"/>
    <map:serialize type="xml"/>

- one of the cincludes is getUser:
<map:match pattern="getUser">
	<map:generate src="system/authentication.xml"/> 
	<!-- this is <session:getxml context="authentication" path="/"/> -->
	<map:transform type="session"/>
	<map:serialize type="xml"/>

Function doSomething() {
 var obj = getObject();
 cocoon.sendPage("internal/anotherForm.html"); <-- ERROR!!

The last line throws an exception which boils down to "cannot find
'authetication' context". I'm fairly sure the exception originates from the

I have to rewrite it to cocoon.sendPage("public/anotherForm.html").

This works in simple cases, but when I add bizData they get lost in the
process. I.e.:

Function doSomething() {
 var obj = getObject();
 var bizData = { object: obj}
 cocoon.sendPage("public/anotherForm.html", bizData); <-- bizData is lost!!

To make things even worse:

I log in successfully and my first redirected page shows. Everything ok. I
now click on a menu item (-> public/doSomething.html). The forms shows ok,
but when I press submit I get the authentication error again. When studying
what happens it looks like a second thread is started (i.e. the function is
executed twice) and the error seems to occur when the second thread tries to
display the form.

What can I do?

Bye, Helma

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message