function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SVSV 

Session Expiration

We have an Sforce 5.0 Partner API client that uses a Web Link to get the sessionID from the SF UI.  We do not use the Sforce login call as we do not have the username and password for the SFDC account.
 
For long running ETL tasks, the Sforce session seems to timeout based on expiration setting in the UI (2 hours) irrespective of the activity. How can we keep the session alive until we are done with the ETL, given that we cannot get a new session id via the login call.
 
thanks
 
PS: A similar topic was discussed earlier, here is the link
benjasikbenjasik
The only way to keep the session live is to re-login. If it's an ETL task, you may want to ask the user to login on your end so you have the username/password to relogin when the session times out.

We will get to fixing this session timeout in the API one of these days.
darozdaroz

I finally ended up coding around this... It's UGLY and not recommended unless you really really really have to do it...

It was explained to me, back before 5.0, when I was dealing with this that the UI will update the session when one half of the session has expired. In other words for a 2 hour expiration the next page load after the first hour will get a new session ID sent.

First, you can presume that if the WIL link is 'fresh' you have about 1 hour of time at a minimum before your session could expire. What I did is 15 minutes before that (45 minutes into the app) I start a new UI session behind the scenes in my app (c# HttpRequest) by passing that session ID to frontdoor.jsp and getting the homepage of the UI. I compare the session cookies set (if any) to see if the UI is trying to rewrite the session ID and capture that. Wash, Soak, Rince and Repeat every hour or so and you can keep going without problems.

benjasikbenjasik
Ok, that's quite inventive, combines a REST API with a SOAP api

We'll try to come up with something to make this less painful.
darozdaroz


benjasik wrote:
Ok, that's quite inventive, combines a REST API with a SOAP api

We'll try to come up with something to make this less painful.


Thanks Benji!

P.S. Anyone want to reimburse the bill from my proctologist?

BlobBlob
Has this been fixed in the API?

How can the organization's timeout setting be retrieved?

Is there a refreshSession() method to call via the API?
SuperfellSuperfell
What we're currently planning on doing is having the service return a SOAP header containing a new sessionId once the existing SessionId > 50% expired. The client can suck the new sessionId out of the response and send it up on subsequent requests. Exactly how much work this is depends on the client soap stack used (e.g. for Axis you need to write a client side handler to do this, .NET will automatigcally do this for you with no additional work).
MichaelR.ax187MichaelR.ax187
Has this been implemented yet or do you have an ETA for it?
SuperfellSuperfell
Its scheduled for the next major release, can't say when that'll be.
BlobBlob
Has this been implemented yet or do you have an ETA for it?
What release was it implemented in?