Jan Hoskens schrieb:

Hello,

> Are you aiming at a site where you can log in on every page and show
> more info/pages if you are logged in? You might want to consider
> using a guest user/role so that everyone visiting the site is
> automatically logged in, but with restrictions attached to that
> "role/user" (so show login form if id/role is guest/guest) and only
> when logging in as a real user/role more options/pages are available.
>
> Do check if you're satisfied with the authentication framework and
> see if it suits your needs:
> http://cocoon.apache.org/2.1/developing/webapps/authentication.html ,
> remember that the framework isn't the perfect solution for every
> problem.

Thanks for your suggestions!
I want to design a site where logged-in Users can see "more" than 
others.

I also thought about your first suggestion, but this would mean that the 
"Guest" User has to login automatically, therefore i would again have 
to write a "workaround" (i.w. pipeline that logs user in) when i use 
the authentication-framework.

And i got the Problem solved like this:

In my authentication XSP which sets the user-id i added:

 <xsp-session:set-attribute 
name="user_id">userID</xsp-session:set-attribute>

after the
 <ID>userID</ID>

Then in Flow or JX i can access this variable like this:
 <jx:set var="user_id" value="${session.getAttribute('user_id')}"/>
 <jx:if test="${empty(user_id)}">
  <!-- display login form on this page -->

This works fine for me.
I don't need any Session-Contexts anymore, i just use the actual session 
which is started on every page.

Christoph

Attachment: pgpdsN0LtClpy.pgp
Description: PGP signature

Reply via email to