cancel
Showing results for 
Search instead for 
Did you mean: 

httpRequest.getSession(true) doesnt give a new session id

govardan_raj
Contributor
0 Kudos

   Hi experts ,

   componentRequest = (IPortalComponentRequest)this.getRequest();

   componentResponse = (IPortalComponentResponse)this.getResponse();

   componentSession = componentRequest.getComponentSession() ;

   httpRequest = componentRequest.getServletRequest();

   httpResponse =componentRequest.getServletResponse(false);

   httpsession = httpRequest.getSession(true);

in the abvove code , httpsession = httpRequest.getsession(false)  -- gets the current session

                   and     httpsession = httpRequest.getsession(true)  -- gets the new session

so in second case when httpRequest.getsession(true) is executed i should get a new session but that is not happening.

Like after executing above code , i got httpsession with id as

follows

(J2EE1252900)ID1474662051DB42ed8b584a1e97ef16d2363a4a2d9980c62cdbb0

now again if i execute the above code i should get another new session with new session id but im still get the above

id itself i.e

(J2EE1252900)ID1474662051DB42ed8b584a1e97ef16d2363a4a2d9980c62cdbb0

My sap Ep version is 7.01

Regards

Govardan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

From the Javadocs:  Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.

govardan_raj
Contributor
0 Kudos

yes java docs illustrate the same , im invalidating the session after logging out , when redirected to another page , on loading the page we are invalidating the session using session.invalidate(); and again on relogging in again , in the same browser we are getting the old session id itself.