Jump to content

Recommended Posts

Posted

It seems that session management for Java servlets does not work consistently.

 

It works for simple JSP pages in public_html:

 

    https://secege.heliohost.org/test.jsp

 

however, when the JSP page is part of a .war deployed application, it does not seem to work:

 

   http://secege.heliohost.org/HelioSecure/

 

(which runs index.jsp)

 

Both JSP pages contain this code:

 

<%
        out.print("Test: ");
        String test = (String) session.getAttribute("some");
        if (test != null) {
            out.println("from session: " + test + "<br>");
        }
        session.setAttribute("some", "A thing");
%>

 

Any help is appreciated.

 

Posted

Sessions are known to not work correctly in wars. If you dig through the history here on the forums, it’s been asked before. I believe only one person has ever gotten them to work reliably in a war file...I’d try to find it for you but I’m on mobile.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...