3 Replies Latest reply on Sep 24, 2007 2:57 PM by alexsmirnov

    funny ajax page after session timeout

    mario_lanza

      I have seen this problem around, but usually the people recommend studying the frameworks used for any solutions. I wasn't able to find anything related to this in Ajax4JSF so maybe somebody around here can help me...

      I have an application which does user authentication with an external proxy. I do some actions and then leave the browser for >30 minutes (web.xml says 30 minutes session-timeout). The proxy which has the same 30 minutes timeout asks for user login, then redirects to the needed page. Now the session in Tomcat has expired as well, so all I get displayed in Internet Explorer is:

      <?xml version="1.0" encoding="UTF-8" ?>
       <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
       <meta name="Ajax-Response" content="redirect">
       <meta name="Location" content="/mycontext/mypage.jsf">
       </head>
       </html>

      That is obviously not what I expected to see, but the redirect to the page shown in the location meta tag. Funny is, that if I press page refresh (as I said I'm in Internet Explorer), the browser tries to interpret the page (at first it does not) and complains about wrong XML (it is wrong as it doesn't have an XML closing tag, but at first it didn't notice), and when I press Refresh AGAIN, it DOES redirect to the right page.
      My question is, why doesn't it redirect from the first try to that page? It is reproducible, and the exact time delay does not seem to matter (it does the same 3-step redirect even if I try after one hour)
      Or, if I have to program something special to handle this timeout in the code, please direct me, in which code do I have to do that, and what to do...
      Thank you very much,
      M