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
Alejandro Ruz CarrascoAlejandro Ruz Carrasco 

Enterprise WSDL API: sessionSecondsValid returns as 0 if the login is performed from a certain machine

I have a webservice that logs to Salesforce, and keeps track in memory of the session expiration by getting the value of loginResult.userInfo.sessionSecondsValid from the SFDC LoginResult part of the WSDL Enterprise API, adding the seconds to a static DateTime object for future evaluations at runtime.

In the development and testing stages (from lots of different workstations and webservers) I had no problems, but after installing it to production I realized that it was login in on each WebMethod call.

I thought the static variable was losing its value, and posted a question in SO about it.

By debugging the condition that determined if there was a need for retrying the login in the production box, i realized that loginResult.userInfo.sessionSecondsValid returned as zero, and checking in my local workstation and other development servers the value correctly returned as 7200 (2 hours for session expiration in our org).

What could cause the difference in the expiration times? some security setting perhaps? Could the server in question be blacklisted in any way?