cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Wyles <>
Subject Saving/Retrieving Session or Request parameters in sitemap
Date Wed, 06 Mar 2002 13:08:21 GMT
Hi All...

I am new to Cocoon 2 and am currently prototyping a login/authentication
routine. I am using SessionIsValidAction to check if the user is logged in,
and if this fails they are redirected to the login page, the
DatabaseAuthenticatorAction is then used to check the user's submitted login
details against values stored in a database. This all works great.

Now I would like to be able to save the original request URI before the
SessionIsValidAction is called so I can then re-direct the user to when the
DatabaseAuthenticatorAction is successful. Here are the pipeline fragments
that control this:

<!-- Check if user is logged in -->
           <map:match pattern="app/*.xml*">
               <map:act type="session-isvalid">
                   <!-- user is logged in -->
                   <map:generate type="file" src="app/{../1}.xml" />
                   <map:transform src="app/default.xsl" />
                   <map:serialize />
               <!-- use is not logged in - redirect to login -->
               <map:generate type="file" src="app/login.xml" />
               <map:transform src="app/default.xsl" />
               <map:serialize />

<!-- Do login -->
           <map:match pattern="app/sign-in*">
               <map:act set="checkUser">
                   <map:parameter name="descriptor"
value="app/users_descriptor.xml" />
                   <!-- Re-direct to original requestURI here -->
               <!-- User cannot be authenticated - back to login -->
               <map:generate type="file" src="app/login.xml" />
               <map:transform src="app/default.xsl" />
               <map:serialize />

Can I do this using the default set of actions that come with Cocoon 2? I
know that I can set a session attribute using the sessionPropagatorAction,
but how do I read it again? I also know I can read a request parameter using
the RequestParamAction but how do I set a request parameter?

I would like to do this within the sitemap rather than resorting to XSP if

Thanks in advance,

Robin Wyles 

Please check that your question has not already been answered in the
FAQ before posting. <>

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

View raw message