Dear All,
I am building a little login test.
It is meaningless, because the login validation is hard-coded but it is a
handy test for me, because I am just learning ;)
Here is a snippet of my (sub) sitemap:
<map:resources>
<map:resource name="login-fs">
<map:generate src="docs/framesets/login.xml"/>
<map:transform src="stylesheets/frameset.xsl"/>
<map:serialize/>
</map:resource>
<map:resource name="welcome-fs">
<map:generate src="docs/framesets/welcome.xml"/>
<map:transform src="stylesheets/frameset.xsl"/>
<map:serialize/>
</map:resource>
</map:resources>
<map:pipelines>
<map:pipeline>
<!-- / -->
<map:match pattern="">
<map:redirect-to session="true" uri="welcome"/>
</map:match>
<!-- /welcome -->
<map:match pattern="welcome*">
<map:act type="session-validator">
<map:parameter name="descriptor"
value="context://r2r/resources/validators/login-test.xml"/>
<map:parameter name="validate-set"
value="is-logged-in"/>
<map:redirect-to session="true"
resource="welcome-fs"/>
</map:act>
<map:act type="form-validator">
<map:parameter name="descriptor"
value="context://r2r/resources/validators/login-test.xml"/>
<map:parameter name="validate-set"
value="is-logged-in"/>
<map:act type="session-propagator">
<map:paramater name="username"
value="{../username}"/>
<map:paramater name="password"
value="{../password}"/>
</map:act>
<map:redirect-to session="true"
resource="welcome-fs"/>
</map:act>
<map:redirect-to session="true" resource="login-fs"/>
</map:match>
</map:pipeline>
</map:pipelines>
This is what the 'login-test.xml' file looks like:
<root>
<parameter name="username" type="string" nullable="no"/>
<parameter name="password" type="string" nullable="no"/>
<constraint-set name="is-logged-in">
<validate name="username" equals-to="jermq"/>
<validate name="password" equals-to="blah"/>
</constraint-set>
</root>
What happens is this:
With URL http://my.ip/c2/r2r/
Matches "/r2r/", redirects to r2r subsitemap "/"
Matches "/", redirects to 'welcome'
Matches 'welcome'
Session Validator fails (as expected)
Form Validator fails (as expected)
Session Propagator fails (as expected)
Redirects to 'login-fs'
User fills in form with 'username' and 'password' posts to 'welcome'
Matches 'welcome'
Session Validator OK
Form Validator OK
Session Propagator OK
Redirects to 'welcome-fs'
I have a session cookie, I am 'logged in'
Up until now, everything has worked as expected
With URL http://my.ip/c2/r2r/welcome
Matches "/r2r/", redirects to r2r subsitemap "/"
Matches "/", redirects to 'welcome'
Matches 'welcome'
Session Validator fails (not expected)
should have redirected to 'welcome-fs'
I appear to have lost my session parameters!
It does not report that there is no Session, only that the 'username'
parameter is now null.
Another thing, I sometimes see the session string on the URL (?), why? I
have it in the cookie ......
Can anyone explain what I am doing wrong?
thanks
regards Jeremy
--
___________________________________________________________________
Jeremy Quinn Karma Divers
webSpace Design
HyperMedia Research Centre
<mailto:[EMAIL PROTECTED]> <http://www.media.demon.co.uk>
<phone:+44.[0].20.7737.6831> <pager:[EMAIL PROTECTED]>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>