cancel
Showing results for 
Search instead for 
Did you mean: 

How to use jsessionid while making HTTP calls??

former_member202208
Active Participant
0 Kudos

Hi All,

How can i use an existing <b>jsessionid</b>, when i make a http call..

When a first call is made to the application, we get a <b>jsessionid</b>, i want to use the same <b>jsessionid</b>, when we make next calls and how do i use it on the server side to identify it on the server side, with this <b>jsessionid</b>, i want to access all those objects which have been created for that <b>jsessionid</b>..

These calls are not context specific, we are making absolute <b>HTTP</b> calls..

Any help would be highly appreciated..

Thanx in Advace.

Shridhar..

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shridbar,

to keep it short: this is all done for you by the hard-working web container.

Since HTTP is stateless, the web container isn't able to know what the user has done before. To keep this state information the server sends you a non-persistent cookie (with your jsessionid) after the first request. Now the web container is able to store user-specific session information (see HttpSession API).

To be honest, I don't know what do you want to achieve or what you're asking for.... maybe a HttpSessionAttributeListener?

Regards, Karsten

former_member202208
Active Participant
0 Kudos

Hi Karsten,

Thanks for your reply..

We are working on B2B and B2C application.. Whenever we login into B2B or B2C, a jsessionid is created and the catalog/shop to which the user is assigned is loaded and all the catalog related information/objects are mapped with that jsessionid, then for all future calls {which are context specific} application will use the same jsessionid and same catalog objects..

Incase we make an absolute <b>HTTP calls</b> to some of the functions, a new jsessionid is created & also the catalog is loaded for each user request and hence the it will hit the performance, so in order to avoid creating new jsessionid and loading of the catalog, i want to pass the previous jsessionid to the server & the server will use the same jsessionid, catalog etc for new request and it may improve the performance of the application. So i want to know how SAP J2EE server, uses the previous jsessionid and extracts information from that particular catalog..

Any help would be highly appreciated..

Thanks in Advance..

Shridhar..

Former Member
0 Kudos

> Incase we make an absolute <b>HTTP calls</b> to some

> of the functions, a new jsessionid is created & also

> the catalog is loaded for each user request and hence

> the it will hit the performance,

Sorry, but I really don't understand that.

Usually, no new jsessionid is created as long as you send the cookie and your session isn't expired.

Regards, Karsten

Former Member
0 Kudos

Can the XI keep such cookies?

Sigiswald
Contributor
0 Kudos

Hi Shridhar,

You mean the web container itself is making an HTTP call instead of the user?

Kind regards,

Sigiswald

Former Member
0 Kudos

Hi Shridhar,

If I understood your question correctly, you mean how to maintain the jsessionid when a HTTP call occurs.

If this HTTP call has nothing related to your client side Java code(for instance, it's not invoked by a JSP page, etc), only thing in mind is the cookie for the browser, but by doing this, you need to sacrifice security.

If the HTTP call is related to your java code on the client side, the hidden field maybe the way you want to go. Basically you can preput the jsession id into a hidden field into the html page or whatever you use and the information will be passed to the server side.

Dennis