Skip to Content
Jan 27, 2021 at 08:40 PM

Is there a way in the Node.js Cloud SDK to use session cookies?


Hello SAP Cloud SDK for Node.JS Experts,

a while ago I've posted the question Slow response times when calling SAP Business One (B1) Service Layer with CAP. In addition to the answer from Maria Trinidad MARTINEZ GEA we've got the following answer from SAP Support:

"I just discussed this with someone from Business One to learn more about the problem.

From the discussion in SAP answers i also learned, that the authentication is done for every call to the B1 system. I also learned that the session keeps alive for 30mins, and after that the authentication is slower again, until the new session in B1 has been established.

So from CAP point of view a possible solution would be to keep the session alive with heartbeat requests every 25mins (or even longer intervals like 29mins if the interval scheduler is accurate enough). If you keep the session alive, with a heartbeat request then there will be no slow requests anymore as long as the session gets random requests and stays active.

We actually also do something similiar with our hana layer, there we use generic-pool and keep multiple connections in the pool and if one times out it is just reconnected, so it can be reused when needed.

This however you have to do in a custom implementation and is nothing, that we can offer generically."

Is there an option to solve that via the SAP Cloud SDK?

Best regards