tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amleto Di Salle" <disa...@di.univaq.it>
Subject R: add a session's attribute after authentication
Date Tue, 02 May 2006 12:27:35 GMT
Hi,
Thank you very much


BR
/Amleto


> -----Messaggio originale-----
> Da: Tim Funk [mailto:funkman@joedog.org] 
> Inviato: martedì 2 maggio 2006 13.14
> A: Tomcat Users List
> Oggetto: Re: add a session's attribute after authentication
> 
> 
> Via tomcat - there isn't a hook. The best (and most portable 
> way) you can do 
> this is to write a filter which checks for the attribute in 
> the session vs 
> the remoteUser value. For example:
> 
> doFilter(...) {
>    if (null!=request.getRemoteUser() &&
>          null==request.getSession().getAttribute("cowbell")) {
>      myCodeWhichInitializesSessionOnLogin();
>    }
>    chain.doFilter(request, response);
> }
> 
> -Tim
> 
> Amleto Di Salle wrote:
> 
> > Hi all,
> > I have used the container (Tomcat) managed security, but after the 
> > authentication I would like to set an object inside the 
> session. How 
> > can I do? I have noticed that Tomcat creates a session if the user 
> > accesses to a protected resource, so i cannot use the 
> > HttpSessionListener.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.5.1/327 - Release 
> Date: 28/04/2006
>  
> 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.5.1/327 - Release Date:
28/04/2006
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message