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
NMISHRANMISHRA 

zksForceClient and logout

Hi,

 

  I'm looking at the zksForceClient and somehow don't see a logout method in there. Is there plan to add logout functionality as well? (An API applicaton can logout from SF.com when it is exiting.)

 

Thanks and regards

 

Best Answer chosen by Admin (Salesforce Developers) 
NMISHRANMISHRA

Thanks. I guess it will take then 2 hours(the default inactivity timeout) right for the user's session to be terminated?

 

Can the zksForceClient instance be reused for doing login as a different user? Or the existing instance should be released and a new instance be used for this purpose?

 

Thanks again and regards

All Answers

SuperfellSuperfell

There's no need to explicity logout the session will expire on inactivity.

NMISHRANMISHRA

Thanks. I guess it will take then 2 hours(the default inactivity timeout) right for the user's session to be terminated?

 

Can the zksForceClient instance be reused for doing login as a different user? Or the existing instance should be released and a new instance be used for this purpose?

 

Thanks again and regards

This was selected as the best answer
NMISHRANMISHRA

NMISHRA wrote:

Thanks. I guess it will take then 2 hours(the default inactivity timeout) right for the user's session to be terminated?

 

Can the zksForceClient instance be reused for doing login as a different user? Or the existing instance should be released and a new instance be used for this purpose?

 

Thanks again and regards


Hi,

 

  Checking again in this regard. Can the zksForceClient be safely reused to login as a different user or should a new instance be created while releasing the earlier instance?

 

Thanks and regards

SuperfellSuperfell

You can safely call login again.

NMISHRANMISHRA

Thanks! I guess you mean on the same zksForceClient instance right? The old session will expire then after 2 hours.

SuperfellSuperfell

Yes

NMISHRANMISHRA

Thanks...it was very helpful! One more question. Is the zkForceClient threadsafe? That is, can it be safely called from multiple threads?

 

Thanks again and regards

SuperfellSuperfell

No, every thread should have its own instance, the ZKSforceClient object implements the NSCopying protocol to make that easy.