PROBLEM USING FILTER TO KNOW SESSION EXPIRATION

Hi, i'm using a filter to know when the session expires but it appeasr not to work, so i am a bit confuse because the filter always executes well but when the session gets the timeout and the user send a request it isnt executed, the server redirects the user to the login page.
I am not sure about it, but is it possible that the reason of why the filter is not executed, is becuase i am using the apache form-authentication????
filter's code:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest req;
RequestDispatcher disp;
HttpServletResponse res;
boolean userInSession;
String forward = getConfig().getInitParameter("sessionClosed");
req = (HttpServletRequest) request;
res = (HttpServletResponse) response;
System.out.println("InFilter");
userInSession = req.getUserPrincipal() != null;
if(userInSession) {
chain.doFilter(request, response);
System.out.println("Session: " + req.getSession(false).getId());
System.out.println("Session: " + req.getSession(false).getMaxInactiveInterval());
System.out.println("getSessionTime: " + req.getSession(false).getCreationTime());
} else {
disp = req.getRequestDispatcher(forward);
disp.forward(request, response);
     res.sendRedirect("http://www.google.com");
System.out.println("outFilter");
tnks
CERR

Hi Robert,
thanks very much for ur pointers on the AuthFilter class.. will try that out.
Robert Greig <[email protected]> wrote:
Stephen wrote:
I am using WLS 6.1 and tried using a custom filter to intercept theauthentication
request submitted from a FORM BASE jsp (using the j_security_checkform).
However, no matter what i've tried, it is always the authenticationpart that
gets executed before the filter.
Any idea how could I intercept the request before the j_security_checkservlet
calls the security provider for authentication?There is a (now deprecated) class weblogic.servlet.security.AuthFilter.
I haven't used it because it is deprecated but I think it does what
you're after.
In my apps, I make the FORM auth submit to my own servlet which can then
do what j_security_check does (most although not all is accessible
through public APIs).
Robert

Similar Messages

  • Session Expired

    Morning
    The problem is that my application not set the session
    timeout correcty and the session always expired after 20 minutes.
    The IIS is correcly configured to support session variables to
    expired after 5 hours.
    <cfapplication name="BrittCafeteatro"
    sessionmanagement="yes" clientmanagement="yes"
    setclientcookies="yes"
    sessiontimeout="#CreateTimeSpan(1, 0, 0, 0)#"
    applicationtimeout="#CreateTimeSpan(3, 0, 0, 0)#">
    The link:
    Can you help me?
    https://www.cafeteatro.com
    Steve Vado
    Web Design Cafebritt S.A.
    Heredia, Costa Rica

    Exactly, the maximun timeout is 1 day but the problem
    persist. Always the session expired around 20 minutes. The
    application.cfm have the same interval.

  • Session expired (timeout) without ADF Security using.

    Hello!
    I have a problem with my application in which i use own security realization without ADF Security using. I realized custom implementation of javax.servlet.http.HttpSessionListener interface, in which i log session creation and expiration events. On WebLogic I realized customDBMS authentification class. Session timeout defined in web.xml (<session-timeout>5</session-timeout>), in weblogic.xml session timeout not define.
    Problem description: when session expired (popup warning displayed before this) and press OK button in popup with session expired warning, I see what no any log about session destroying from my HttpSessionListener implementation, so I cant understand, what session expired and process this event in my servlet filter. So I stay at same page (but without data in tables, coz binding variables in VO queries is not defined). If I am not click OK in the popup and wait about minute, then appear a log message about the destroying the session from my HttpSessionListener implementation. Why is the delay between the appearance of warning session expired and the actual destroying of the session in WebLogic?
    I use JDeveloper 11.1.1.6.0, application deployed in integrated WebLogic 10.3.5.0

    Hi,
    Why is the delay between the appearance of warning session expired and the actual destroying of the session in WebLogic?Because warning is given about 2-3 min before session expire
    That is why
    If I am not click OK in the popup and wait about minute, then appear a log message about the destroying the session from my HttpSessionListener implementation.

  • Session Expired - SessionManager Problem?

    This is a OAS4.0.8.1 problem.
    Session Expired message comes when the cartridge times out and exited. However, my servlet have no means to process this exception.
    By enabling the logging, the problems seems to be from oracle.oas.session.SessionManager.resumeSession(). Can't find documentation on SessionManager object. How can I control this from my servlet or OAS admin?
    The log file shows that resumeSession() causes a SessionNotFoundException under log level 3.
    This error can be easily repeated if you access a servlet page, shutdown your servlet cartridge using admin, and refresh the servlet page.
    Please help if you know.
    THanks :)
    null

    Hi,
    OAS has a limitation of 300 seconds. This value cannot be changed. See the release notes.
    One possible way to get around this is to use the Oracle Supplied Session class and use the time feature in that.
    This a big limitation and I am not sure why Oracle designed the product this way.
    null

  • Session Expired Problem on OAS

    Hi,
    I often got the error message "Session Expired" displayed on my HTML page that serves Java Servlet output after some time.
    I attempted to look through my Servlet source codes but it has no problem. In fact, it runs perfectly well on JavaWebServer2.0.
    This seems to be a OAS problem. I'm using Oracle Application Server 4.0.8.1. I attempted changing the Servlet Cartridge's "Max session idle time" and observe the behaviour. It appears that when "Session Expired" problem happened, my servlet class never get called. OAS simply display a "Session Expired" message on the web page.
    How can I avoid this? How can ask OAS to call my servlet's doGet() to create a new session when it expired?
    Anyone knows how?
    null

    Hi,
    OAS has a limitation of 300 seconds. This value cannot be changed. See the release notes.
    One possible way to get around this is to use the Oracle Supplied Session class and use the time feature in that.
    This a big limitation and I am not sure why Oracle designed the product this way.
    null

  • Session Expired Problem

    Hi,
    I often got the error message "Session Expired" displayed on my HTML page that serves Java Servlet output.
    I attempted to look through my Servlet source codes but it has no problem. In fact, it runs perfectly well on JavaWebServer2.0.
    This seems to be a OAS problem. I'm using Oracle Application Server 4.0.8.1. Sorry to post it here as I couldn't find a OAS topic.
    Anyone knows why?
    null

    Hi,
    OAS has a limitation of 300 seconds. This value cannot be changed. See the release notes.
    One possible way to get around this is to use the Oracle Supplied Session class and use the time feature in that.
    This a big limitation and I am not sure why Oracle designed the product this way.
    null

  • Hi, I cant login to the facebook app on my iphone 5 ios 6.0.2.  I keep getting an error message saying 'There was an error logging in using single sign on' when im asked to log in again i get a 'session expired' message.  This only started happening yeste

    Hi, I cant login to the facebook app on my iphone 5 ios 6.0.2.  I keep getting an error message saying 'There was an error logging in using single sign on' when im asked to log in again i get a 'session expired' message.  This only started happening yesterday. Anyone else having this problem? Thanks.

    I am having the same problem and took the following steps to mitigate it to no avail.
    1. I deleted the Facebook app on the phone and turned off Facebook in the iPhone's system-wide settings.
    2. I re-enabled Facebook in the iPhone's system-wide settings and reinstalled the Facebook app and logged in again. It worked. For about an hour.
    3. I completely restored the phone to a previous backup (before the problems started) and reenabled Facebook .... reinstalled the app.... and now it works intermittenly. But it hasn't worked in about 12 hours now (just tried a few minutes ago).
    Please advise.

  • I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve things under an old Apple ID when the email used for that account no longer exists? I am trying to update a number of apps that was bought under an

    I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve apps under an old Apple ID when the email used for that account no longer exists &amp; I can't remember the password? After speaking with Apple Acct. Security, I got the security Q right but my birthday was wrong! They wanted the serial number from my phone that was 3 iPhones ago! Seriously??!!
    Any updated way to work around this? No Apple people can correct it.
    Thanks,
    Joe

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (122986)

  • Hi, i have a macbook air and i've been having problems with the camera when i'm using skype. i know im no the 1st one and i'd like to know when apple or someone 'll do something about this.

    hi, i have a macbook air and i've been having problems with the camera when i'm using skype. i know im no the 1st one and i'd like to know when apple or someone 'll do something about this.

    Try reinstalling Combo Update.
    http://support.apple.com/kb/DL1676
    Best.

  • Session expired error(ISS , ASP related problem

    We have one server which contain both ISS & WEB server ,on this server the database is running perfectly all right, also we are able to access the our site also (Named as UMPIRE ), but after few seconds , we get an error that the session is expired. Again when we refresh the page it start running. As per my knowledge, I think the session expire time given to the site is very less
    Actually the web page is on ASP and ISS is installed on the server , i think some configuration setting is to be required for the ISS , after the installation
    Can anybody help in this regard , what are the reason to get this error
    Session expired
    and whhat is the solution to remove this error

    And just how does this forum's subject matter, SQL and PL/SQL, factor into your problem and question about ISS configuration?

  • Hello i have a problem that i was making update IOS7 for my i phone 5 it's taking a lot of time about 4 hours till now, i can't use my phone know, it's appere logo i tunes only, can't do eny thing else like shutdown

    Hello i have a problem that i was making update IOS7 for my i phone 5 it's taking a lot of time about 4 hours till now, i can't use my phone know, it's appere logo i tunes only, can't do eny thing else like shutdown

    Hey Andrew keriakous,
    Thanks for the question. It sounds like your iPhone may be in recovery-mode. To resolve this issue, see the following:
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808
    Thanks,
    Matt M.

  • Navigation problem while using filter

    hai,
    I have a requirement that I use filter settings for my table.. when I use 2 or 3 checks in filter and sorting
    I need to navigate to the previous check  with the use of button above the table...
    kindly help

    hi ,
    pls use  the ZCi layout for the adobe interactive form .
    Need to Insert the web dynpro script to the form.
    Note: Make sure to upgrade the Adobe Interactive for ZCI type using SFP_ZCI_UPDATE transaction
    Subsequently, check whether the update of the ZCI was successfully completed. To do this, open your form in the Adobe LiveCycleDesigner and check the version information of the ZCI script. The ZCI script is available on the "Hierarchy" tab page under the "ContainerFoundation_JS" name. The version must be800.20080513120641.469612.469346.
    You can also have a look at this e-learning.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20029530-54ef-2910-1b93-c41608ae0c90
    Refernce thread : adobe online interactive form
    regards ,
    amit

  • Process Integrator Problem (use of session bean variable between tasks)

    Hello,
    I'm having a problem using the Process Integrator. I made a
    really simple workflow (Start, Task1, Task2, Done) which uses
    the bean given whith the order processing example. Task1 creates
    the bean and executes a business operation (check inventory).
    Task2 executes another business operation (calculate total
    price). The problem is when I try to execute this second b.o I
    get an exception saying
    Nested exception is: Workflow error:
    com.bea.wlpi.common.WorkflowException: Empty instance object for
    business operation "Calculate Total Price" in
    template "Template3".
    Someone could help me and tell me what I am doing wrong.
    Thanks in advance,
    Albert

    If I understand you correctly, you have 3 business operations, one is "Create a EJB",
    one is call "Check Inventory", the other is "Caculate Total Price". I assume you
    save the EJB handle to a workflow variable with a type Bean. My speculation is when
    you define business operation for "Calculate Total Price", you did not associate
    it with the workflow variable that you saved the EJB handle. Just a wild guess.
    Jim Zhou.
    "Albert Lanchas" <[email protected]> wrote:
    >
    Hello,
    I'm having a problem using the Process Integrator. I made a
    really simple workflow (Start, Task1, Task2, Done) which uses
    the bean given whith the order processing example. Task1 creates
    the bean and executes a business operation (check inventory).
    Task2 executes another business operation (calculate total
    price). The problem is when I try to execute this second b.o I
    get an exception saying
    Nested exception is: Workflow error:
    com.bea.wlpi.common.WorkflowException: Empty instance object for
    business operation "Calculate Total Price" in
    template "Template3".
    Someone could help me and tell me what I am doing wrong.
    Thanks in advance,
    Albert

  • SJSAS 9 and JSF - session expiration

    Hi
    I'm developing JSF (1.2) application. I'm using SJSAS 9, EJB 3.0 and toplink. My problem is session expiration. When user session expires and then user click for example on Save button on JSF form, application goes to login page, but after login user receive Internal server Error screen. As I see, session expires but after login, POST request is resend but all related objects don't exist any more (NullPointerException occurs in prerender method). Currently I'm redirecting to main page using following code:
    public static ExternalContext getExternalContext() {
            return FacesContext.getCurrentInstance().getExternalContext();
    getExternalContext().redirect(MAINPAGESTR);
    ...in try catch block ,in prerender method (JSF). Does anybody knows what should I do?

    Have you tried to set a servlet filter to catch the error and build a nicer page?
    If you can tell me how to set up a short session expiration time on Tomcat,
    I can do the tests.
    I am interrested in this issue as I will have to solve it for a project in the
    next 2 weeks.

  • Problem using trinidad 2.0 and facelets

    Hi everyone!!!
    I am facing problem using Trinidad 2.0 components with facelets. I am using Tomcat 6.0 server , 1.6_20 jdk with jre6. I am using springsource tool suite as an IDE.
    My problem is regarding usage of facelets with trinidad component library. I am trying to run *<tr:panelTabbed>* component of TRINIDAD 2.0 on *.jsp* as well as *.xhtml*. If I run my jsp , I am able to used panel tab fully like switching between two tabs. Same code I have added in my .xhtml page in the same project under *<ui:composition>* tags. I am successfully able show the component on the screen , but I am not able to switch between the two tabs. Here are the list of libs that have added to the project.
    commons-beanutils-1.7.0.jar,commons-codec-1.3.jar,commons-collections-3.2.jar,commons-digester-1.8.jar,commons-discovery-0.4.jar,
    commons-el.jar,commons-fileupload.jar,commons-logging-1.1.1.jar,jsf-facelets.jar,jstl.jar,myfaces-api-2.0.1.jar,myfaces-impl-2.0.1.jar,
    trinidad-api-2.0.0-alpha-2.jar,trinidad-impl-2.0.0-alpha-2.jar
    index.jsp
    <%@taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%><html>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <head>
    <title>Your first JSF Application</title>
    </head>
    <body bgcolor="white">
    <f:view>
         <tr:document>
              <h:form>
                   <tr:panelTabbed position="above">
                        <tr:showDetailItem text="Account">
                             <tr:panelBox text="Account Information Details"
                                  inlineStyle="width: 100%;">
                                  <tr:panelList inlineStyle="width: 100px;">
                                       <tr:panelHorizontalLayout inlineStyle="height:100px;">
                                            <f:facet name="separator">
                                                 <tr:spacer width="100" height="100" />
                                            </f:facet>
                                            <tr:outputText value="Account Number" styleClass="AFFieldText" />
                                            <tr:outputText value="Effective Date" styleClass="AFFieldText" />
                                            <tr:outputText value="Expiration Date" styleClass="AFFieldText" />
                                       </tr:panelHorizontalLayout>
                                       <tr:panelHorizontalLayout inlineStyle="height:100px;">
                                            <f:facet name="separator">
                                                 <tr:spacer width="100" height="100" />
                                            </f:facet>
                                            <tr:outputText value="#{accDet.accountNumber}"
                                                 styleClass="AFFieldText" />
                                            <tr:outputText value="#{accDet.effectiveDate}"
                                                 styleClass="AFFieldText" />
                                            <tr:outputText value="#{accDet.expirationDate}"
                                                 styleClass="AFFieldText" />
                                       </tr:panelHorizontalLayout>
                                       <tr:separator />
                                       <tr:panelHorizontalLayout inlineStyle="height:100px;">
                                            <f:facet name="separator">
                                                 <tr:spacer width="100" height="1" />
                                            </f:facet>
                                            <tr:outputText value="Address" styleClass="AFFieldText" />
                                            <tr:outputText value="Fax" styleClass="AFFieldText" />
                                       </tr:panelHorizontalLayout>
                                       <tr:panelHorizontalLayout inlineStyle="height:100px;">
                                            <f:facet name="separator">
                                                 <tr:spacer width="100" height="1" />
                                            </f:facet>
                                            <tr:outputText value="#{accDet.address}"
                                                 styleClass="AFFieldText" />
                                            <tr:outputText value="#{accDet.fax}" styleClass="AFFieldText" />
                                       </tr:panelHorizontalLayout>
                                  </tr:panelList>
                             </tr:panelBox>
                        </tr:showDetailItem>
                        <tr:showDetailItem text="Insured">
                             <tr:panelHeader text="Header 2">
                                  <tr:panelFormLayout>
                                       <tr:inputText label="Text1" />
                                       <tr:inputText label="Text2" />
                                       <tr:inputText label="Text3" />
                                  </tr:panelFormLayout>
                             </tr:panelHeader>
                        </tr:showDetailItem>
                   </tr:panelTabbed>
              </h:form>
         </tr:document>
    </f:view>
    </body>
    </html>
    guess.xhtml
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:tr="http://myfaces.apache.org/trinidad"
         xmlns:f="http://java.sun.com/jsf/core">
    <body bgcolor="white">
    <f:view>
         <tr:document>
    <h:form>
         <tr:panelTabbed>
              <tr:showDetailItem text="Tab 1"></tr:showDetailItem>
              <tr:showDetailItem text="Tab 2"></tr:showDetailItem>
         </tr:panelTabbed>
    </h:form>
    </tr:document>
    </f:view>
    </body>
    </html>
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="WebApp_ID" version="2.5">
         <display-name>Demo_ProtoType</display-name>
         <filter>
              <filter-name>trinidad</filter-name>
              <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
         </filter>
         <filter-mapping>
              <filter-name>trinidad</filter-name>
              <servlet-name>faces</servlet-name>
         </filter-mapping>
         <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>client</param-value>
         </context-param>
         <listener>
              <listener-class>
                   org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
         </listener>
         <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.xhtml</url-pattern>
         </servlet-mapping>
         <servlet>
              <servlet-name>resources</servlet-name>
              <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>resources</servlet-name>
              <url-pattern>/adf/*</url-pattern>
         </servlet-mapping>
         <context-param>
              <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
              <param-value>org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletViewHandler</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.trinidad.FACELETS_VIEW_MAPPINGS</param-name>
              <param-value>*.xhtml</param-value>
         </context-param>
    </web-app>
    faces-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
         version="1.2">
         <application>
              <default-render-kit-id>org.apache.myfaces.trinidad.core</default-render-kit-id>
         </application>
         <managed-bean>
              <managed-bean-name>accDet</managed-bean-name>
              <managed-bean-class>com.csc.Account.AccountDetail</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
    </faces-config>Following warning is coming on server start up
    java.lang.ClassNotFoundException: org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletViewHandler
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
    PLEASE LET ME KNOW IF ANYONE NEED THE .WAR file .I can send it over mail. Please hrlp me out !!! I have literally tried everything.This is the only HOPE

    Hi gimbal2 ,
    thanks for your prompt response.
    I deleted jsf-facelets.jar from the lib.
    Also I removed      <context-param>
              <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
              <param-value>org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletViewHandler</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.trinidad.FACELETS_VIEW_MAPPINGS</param-name>
              <param-value>*.xhtml</param-value>
         </context-param>Now that error has gone .But I am still not able to switch between the tabs for .xhtml page but it is working fine for .jsp page.
    For .xhtml page , on clicking on the tab, console is showing something like below
    Aug 17, 2010 9:20:49 PM org.apache.myfaces.trinidad.component.UIXShowDetail broadcast
    WARNING: Event org.apache.myfaces.trinidad.event.DisclosureEvent[phaseId=INVOKE_APPLICATION(5),component=CoreShowDetailItem[UINodeFacesBean, id=j_id957384125_39108532],expanded=true] was delivered to a showDetail already in that disclosure state.

Maybe you are looking for