You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bruno Pierre <br...@yahoo.fr> on 2003/06/20 00:24:33 UTC

session-validator problem

Hello,

I've downloaded cocoon a month ago and it's good but hard.
I've a problem when trying to adapt the "protected" tutorial to my application.

here is a part of my sitemap.xmap

      <map:match pattern="login.html">
        <map:aggregate element="page">
          <map:part src="cocoon:/session"/>
          <map:part src="cocoon:/request"/>
          <map:part src="module/login.xml"/>
        </map:aggregate>
        <map:transform src="stylesheets/2html.xsl"/>
        <map:serialize/>
      </map:match>

      <map:match pattern="*.html">
        <map:act type="session-validator">
          <map:parameter name="descriptor" value="context://K/descriptors/params.xml"/>
          <map:parameter name="validate" value="user_id"/>
          <map:aggregate element="page">
            <map:part src="cocoon:/session"/>
            <map:part src="cocoon:/request"/>
            <map:part src="module/{1}.xml"/>
          </map:aggregate>
          <map:transform src="stylesheets/2html.xsl"/>
          <map:serialize/>
        </map:act>
        <map:redirect-to uri="login.html"/>
      </map:match>

there is no problem with the login page but when i log in the 
        <map:act type="session-validator">
failed even if there is a user_id=0 in the session (i know it because i put the user_id in the title of the html page)
my params.xml looks like :

<?xml version="1.0" encoding="UTF-8"?>
<parameters-descriptor>
  <parameter name="user_id" type="long" nullable="no"/>
<parameters-descriptor>

i don't understand because it seems to be really like the tutorial

many thanks.