Hi all,
I try to use a filter for the authentication so I created a class which
implements filter with the following doFilter method (I found this in a
post)
<code>
public void doFilter(ServletRequest _request, ServletResponse _response,
FilterChain _chain)
throws IOException, ServletException
{
String redirectFailure = "/logon.jsp";
HttpSession session = ((HttpServletRequest)_request).getSession(false);
if ((session == null) || (session.getAttribute("loggedIn")== null) )
{
context.getRequestDispatcher(redirectFailure)
.forward(_request,_response);
}
else {
_chain.doFilter(_request, _response);
}
}
</code>
I added this in the web.xml file:
<code>
<filter>
<filter-name>SessionFilter</filter-name>
<filter-class>dbmanager.SessionFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SessionFilter</filter-name>
<url-pattern>/DBManager/*</url-pattern>
</filter-mapping>
</code>
and I also :
- setted nocache to true for the Action servlet
- in lofgoff I invalide the session I create in login along with the
loggedIn variable
The problem : when I log out and then do a back to the last page everything
is working !!!
I overlooked something, any ideas?
Thanks,
Cezar
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]