ahaaaaaaaaa...................
if you are using Weblogic 5-6 then I know exactly what going on ....:)
the problem is when you call session.invalidate() and then do a forward,
your session is not invalidated.  So if you invalidate your current session
and do a redirect to where ever you want to go instead, then your session
will get invalidated correctly.  More than six months ago I was submitting
this to BEA, I have no idea why the can reproduce this, instead they ask me
to write a simple test case for them which decline because I was so bussy.

danny

> -----Original Message-----
> From: Adam Hardy [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, May 14, 2002 5:15 AM
> To:   Struts Users Mailing List
> Subject:      Re: LogoutAction
> 
> Whoops. I see I�m behind everyone else.
> 
> Villegas, Courtney wrote:
> 
> >ALl of my jsp pages check to see whether a user is logged on.  After
> calling
> >the logout action, I am still able to navigate to my other jsp pages.
> This
> >does not happen every time.  I am really tearing my hair out trying to
> >debug, because the results are not consistent.
> >
> >Courtney
> >
> >-----Original Message-----
> >From: Mannem, Taati [mailto:[EMAIL PROTECTED]]
> >Sent: Monday, May 13, 2002 4:09 PM
> >To: Struts Users Mailing List
> >Subject: RE: LogoutAction
> >
> >
> >Can you please be more clear? What do you mean by "does not actually log
> the
> >user out"?whats happening there?
> >
> >
> >Regards,
> >Taati
> >  
> >
> >>-----Original Message-----
> >>From:       Villegas, Courtney [SMTP:[EMAIL PROTECTED]]
> >>Sent:       Monday, May 13, 2002 6:53 PM
> >>To: '[EMAIL PROTECTED]'
> >>Subject:    LogoutAction
> >>
> >>I am having troubles with the logout action that I have written.  It
> >>directs
> >>me to the correct page, but does not actually log the user out and close
> >>the
> >>session.  I have attached my action and the info from my struts-config
> >>file.
> >>I am calling session.invalidate() incorrectly?
> >>
> >>Thanks
> >>Courtney
> >>
> >>        <!--************************************* Logoff Action
> >>*************************************-->
> >>        <action    path="/logoff"
> >>                   type="org.trimet.security.actions.LogoffAction"
> >>                   scope="request">
> >>          <forward name="success"              path="/jsp/ctest.jsp"/>
> >>        </action>
> >>
> >>package org.trimet.security.actions;
> >>
> >>import java.io.IOException;
> >>import java.lang.reflect.InvocationTargetException;
> >>import java.util.Locale;
> >>import java.util.Vector;
> >>import javax.servlet.RequestDispatcher;
> >>import javax.servlet.ServletException;
> >>import javax.servlet.http.HttpServletRequest;
> >>import javax.servlet.http.HttpSession;
> >>import javax.servlet.http.HttpServletResponse;
> >>import org.apache.struts.action.Action;
> >>import org.apache.struts.action.ActionForm;
> >>import org.apache.struts.action.ActionForward;
> >>import org.apache.struts.action.ActionMapping;
> >>import org.apache.struts.action.ActionServlet;
> >>import org.apache.struts.util.MessageResources;
> >>import org.apache.commons.beanutils.PropertyUtils;
> >>
> >>import org.trimet.security.states.Constants;
> >>import org.trimet.security.states.User;
> >>
> >>/**
> >> * Implementation of <strong>Action</strong> that logs user out of
> current
> >>session 
> >> *
> >> * @author Courtney S. Villegas
> >> * @version $Revision: 1.0 $ $Date: 2002/05/13 03:03:00 $
> >> */
> >>
> >>public final class LogoffAction extends Action {
> >>
> >>
> >>    // --------------------------------------------------------- Public
> >>Methods
> >>
> >>
> >>    /**
> >>     * Process the specified HTTP request, and create the corresponding
> >>HTTP
> >>     * response (or forward to another web component that will create
> it).
> >>     * Return an <code>ActionForward</code> instance describing where
> and
> >>how
> >>     * control should be forwarded, or <code>null</code> if the response
> >>has
> >>     * already been completed.
> >>     *
> >>     * @param mapping The ActionMapping used to select this instance
> >>     * @param actionForm The optional ActionForm bean for this request
> (if
> >>any)
> >>     * @param request The HTTP request we are processing
> >>     * @param response The HTTP response we are creating
> >>     *
> >>     * @exception IOException if an input/output error occurs
> >>     * @exception ServletException if a servlet exception occurs
> >>     */
> >>    public ActionForward perform(ActionMapping mapping,
> >>                             ActionForm form,
> >>                             HttpServletRequest request,
> >>                             HttpServletResponse response)
> >>    throws IOException, ServletException {
> >>
> >>    // Extract attributes we will need
> >>    Locale locale = getLocale(request);
> >>    MessageResources messages = getResources();
> >>    HttpSession session = request.getSession();
> >>    String action = request.getParameter("Load");
> >>    if (action == null)
> >>        action = "Load";
> >>        if (servlet.getDebug() >= 1)
> >>            servlet.log("LogoffAction:  Processing " + action +
> >>                        " action");
> >>
> >>    // Is there a currently logged on user?
> >>    User user = (User) session.getAttribute(Constants.USER_KEY);
> >>    if (user == null) {
> >>        if (servlet.getDebug() >= 1)
> >>            servlet.log(" User is not logged on in session "
> >>                        + session.getId());
> >>        return (servlet.findForward("logon"));
> >>    }
> >>
> >>
> >>    // Forward control to the GISAppDev page
> >>        if (servlet.getDebug() >= 1)
> >>            servlet.log(" Forwarding to 'GIS App Dev' page");
> >>        user=null;
> >>        session.invalidate();    
> >>    return (mapping.findForward("success"));
> >>
> >>    }
> >>
> >>
> >>}
> >>
> >>--
> >>To unsubscribe, e-mail:
> >><mailto:[EMAIL PROTECTED]>
> >>For additional commands, e-mail:
> >><mailto:[EMAIL PROTECTED]>
> >>    
> >>
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >
> >--
> >To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
> >  
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to