cancel
Showing results for 
Search instead for 
Did you mean: 

NW7.3 - jsessionid not renew when session created

Former Member
0 Kudos

Hi Gurus,

I am using NW AS Java 7.3. I have a problem with the jsessionid as is not renew when a new session is created when a HTTP request with a URL contains the jsessionid. I have created a simple test case:

HTTP request (GET):

http://127.0.0.1:50000/login.do;jsessionid=gYArgRJKi-vPaGaS5Pm6FJ0rBFiiPwGK8H8A_SAPEnAYRDDZbFI4us7UI9Xyyn;saplb_*=(J2EE8114620)8114650

Login.java:

    protected void doGet(HttpServletRequest request, HttpServletResponse response)

        throws ServletException, IOException {

        response.setContentType("text/html");

        PrintWriter out = response.getWriter();

        out.println("<html><body>Logging on");

        HttpSession session = request.getSession(false);

        if (session != null) {

            session.invalidate();

        }

        out.println("</p>request.getSession(true);</p>");

        session = request.getSession(true);

        out.println("</p>session.getId()=</p>" + session.getId());

        out.println("</body></html>");

    }

Result:

    Logging on

    request.getSession(true);

    session.getId()=

    gYArgRJKi-vPaGaS5Pm6FJ0rBFiiPwGK8H8A_SAP

Meaning with the same URL, the exact same jsessionid (gYArgRJKi-vPaGaS5Pm6FJ0rBFiiPwGK8H8A_SAP) will be created always. Additionally, my business requirement requires to always use URL session tracking. Hence, I have web-j2ee-engine.xml:

    <url-session-tracking>true</url-session-tracking>

I have checked SAP note 1310561. It states that such session fixation issue have been resolved in NW 7.3. How to have the jsessionid renew when a session is created even though it is jsessionid is specified in the URL and url session tracking is always enabled?

Or it is the SessionIdRegenerationEnabled is not applicable to 'url-session-tracking = true' scenario?

Thanks a lot first. Any help will be appreciated greatly.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

First off what SP level do you have in your NW73 system?

I'm not 100% sure but I don't think the two parameters are dependent from each other.

Can you share the business requirement for URL session tracking? Setting url-session-tracking to true means that URL rewriting is always done where as with the default setting (false) cookies will be used if the client supports it, otherwise URL rewriting will be used.

Setting SessionIdRegenerationEnabled to true will enable additional checks, another parameter (JSessionMarkId) is automatically generated.

Former Member
0 Kudos

Hi,

Thanks for the reply.

I cannot find the SP level. I have tried a few days but still cannot get it from JSPM or SUM.

Anyways, I have some other details:

SAP Java EE Application Server Version 7.31

Patchlevel 3710.148365

In case of the the business requirement for URL session tracking, there is a legacy application which does not support cookies need to access my website. I need to make sure the session fixation is not occurring in such case as mentioned in my initial question.

Thanks.

Former Member
0 Kudos

You can find the SP level in System Information /nwa/sysinfo. Switch to Components Info tab, you will find it there (1000.7.31.X.Y).

Former Member
0 Kudos

Hi,

Thanks for the help anyway. X = 1, Y = 0.

Anyhow, I had removed <url-session-tracking>true</url-session-tracking> eventually.

Former Member
0 Kudos

HI Lam Jack,

did you ever figure out why the session-id never did change and how to force the system?

I have kind of experienced the same a while ago

Regards,

Andreas

Former Member
0 Kudos

Not sure if it will help but you can try to trace user session as described in Tracing Single User Sessions. May be it shed light on the problem.