You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by H....@MI.unimaas.nl on 2004/05/13 13:55:13 UTC
RE: Problem with losing session context 'authentication' - lookin
g fo r workaround or bugfix
Hi Joerg,
Yes, I have done some remote debugging, and I'm not sure if I've come across
the actual problem (my knowledge of the inner workings are too limited for
that). I did notice however that the
o.a.c.components.flow.javascript.fom.FOM_JavaScriptInterpreter$ThreadScope
has a variable "useSession" which is always "false". Its comment says:
/* true if this scope has assigned any global vars */
As said, I'm not sure what it means, so I'm unable to figure out how to get
it to true and even if it's true whether it wil solve my problem. :-(
Bye, Helma
> -----Original Message-----
> From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
> Sent: Thursday, 13 May 2004 01:48
> To: users@cocoon.apache.org
> Subject: Re: Problem with losing session context
> 'authentication' - looking fo r workaround or bugfix
>
>
> No help from my side and not much time to investigate at the
> moment. It
> really sounds weird. And - that's the reason I write - I fear that I
> will come to the same problem when I switch on authentication in my
> application. I already have some test pipelines as it is my first
> project with authentication framework. Have you done some remote
> debugging to see what's going on?
>
> Joerg
>
> On 12.05.2004 00:22, H.vanderLinden@MI.unimaas.nl wrote:
>
> > Hi,
> >
> > 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:
> >
> > Setup:
> > - default Cocoon root sitemap with automounted subsitemap of my app.
> > - authentication-fw setup like the sample with the
> flowscripts (auth.js).
> > Works.
> > - all "public" urls go through the "protect" function to
> their "internal"
> > counterpart.
> > - 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:transform>
> > <map:call resource="html-layout"/>
> > <map:serialize type="xml"/>
> > </map:match>
> >
> > - 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"/>
> > </map:match>
> >
> > Function doSomething() {
> > var obj = getObject();
> > form.load(obj);
> > form.showForm("internal/someForm.form");
> > form.save(obj);
> > storeObject(obj);
> 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 sessionTransformer.
> >
> > 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();
> > form.load(obj);
> > form.showForm("internal/someForm.form");
> > form.save(obj);
> > storeObject(obj);
> > 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: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: Problem with losing session context 'authentication' - looking
fo r workaround or bugfix
Posted by Antonio Gallardo <ag...@agssa.net>.
Hi Helma:
H.vanderLinden@MI.unimaas.nl dijo:
>> > Setup:
>> > - default Cocoon root sitemap with automounted subsitemap of my app.
Hmm. Maybe here is the problem. Can you provide the sitemap.xmap of
configured auth-fw?
>> > - authentication-fw setup like the sample with the
>> flowscripts (auth.js).
>> > Works.
>> > - all "public" urls go through the "protect" function to
>> their "internal"
>> > counterpart.
>> > - 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:transform>
>> > <map:call resource="html-layout"/>
>> > <map:serialize type="xml"/>
>> > </map:match>
>> >
>> > - 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"/>
>> > </map:match>
I will try to find/debug the problem in the above match too.
>> > Function doSomething() {
>> > var obj = getObject();
>> > form.load(obj);
>> > form.showForm("internal/someForm.form");
>> > form.save(obj);
>> > storeObject(obj);
>> cocoon.sendPage("internal/anotherForm.html"); <--
>> > ERROR!! }
What kind of Object the getObject() retrieve? It is related to sessions?
>> > The last line throws an exception which boils down to "cannot find
>> > 'authetication' context". I'm fairly sure the exception originates
>> > from the sessionTransformer.
It could be. I think we need to review it.
>> > 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.:
It is weird.
>> >
>> > Function doSomething() {
>> > var obj = getObject();
>> > form.load(obj);
>> > form.showForm("internal/someForm.form");
>> > form.save(obj);
>> > storeObject(obj);
>> > 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.
>> >
Best Regards,
Antonio Gallardo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org