[jetty-user] session timeout

Gary McWilliams <[email protected]>
Newsgroups gmane.comp.java.jetty.support
Message-ID <[email protected]>
Using Jetty 6, embedding Jetty, we have code such as:

                                                Server server = new Server();
                                                mWebApplicationContext = new WebAppContext();
                                                mWebApplicationContext.setContextPath("/" + CONTEXT_PATH);
                                                mWebApplicationContext.setWar(MOBILE_WEB_APP_FILE);
                                                // Testing session timeout >>>
                                                SessionHandler sh = mWebApplicationContext.getSessionHandler();
                                                SessionManager sm = sh.getSessionManager();
                                                mLogger.debug("Setting max-timeout");
                                                System.out.println("Setting setMaxInactiveInterval(300)");
                                                sm.setMaxInactiveInterval(300);
                                                // <<< Testing session timeout
                                                server.addHandler(mWebApplicationContext);

We added the "test session timeout" bits recently. The problem we have is that this is not taking effect and sessions time out after 30 minutes (we have real user use-cases where this is a problem), so we are trying to remove the timeout. In the above we are setting a 5 minute timeout to check this change takes effect, then we can increase the timeout.

When a request comes in, we do:
                public void doGet(HttpServletRequest aRequest, HttpServletResponse aResponse)
                                                throws ServletException, IOException
                {
                                System.out.println("session timeout:" + aRequest.getSession().getMaxInactiveInterval());


This always shows a max idle of 30 minutes.

Am I doing the correct configuration logic in my code? Is it possible to change (make infinite) the session timeout?


________________________________
The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error.

The views and opinions expressed in this email may not reflect the views and opinions of any member of Lagan Technologies Limited, or any of its subsidiaries.

Lagan Technologies Limited is a company registered in Northern Ireland with registration number NI 28773. The registered office of Lagan Technologies Limited is 209 Airport Road West, Belfast, Co. Antrim, BT3 9EZ.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.