Jump to content

Java session management


secege

Recommended Posts

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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...