Title: Random logouts
Last modified: January 19, 2017

---

# Random logouts

 *  [efkwp](https://wordpress.org/support/users/efkwp/)
 * (@efkwp)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/random-logouts/)
 * The Salesforce extension for Gravity Forms is logging out of Salesforce frequently(
   daily ore more) on the five WordPress sites we maintain for advertising tracking.
   This only began when we went from one site to five. The logs (see below) suggest
   this might be avoided by setting the Refresh Token Policy to “Refresh token is
   valid until revoked”. But in the Salesforce admin view, the plugin doesn’t show
   under Connected Apps, which is where one can edit that setting, and there are
   no configuration options for the plugin under Connected Apps OAuth Usage.
 * Thanks!
 * 2017-01-17 5:31:54.572107 – ERROR –> get_api(): There was an error getting the
   connection to Salesforce. The error message was: INVALID_SESSION_ID: This session
   is not valid for use with the API
    Here’s the exception: SoapFault Object ( [
   message:protected] => INVALID_SESSION_ID: This session is not valid for use with
   the API [string:Exception:private] => [code:protected] => 0 [file:protected] 
   => /var/www/cms-prod/archives/2017-01-17-101854-cms-1484666628/wp-content/plugins/
   gravity-forms-salesforce/lib/Force.com-Toolkit-for-PHP/soapclient/SforceBaseClient.
   php [line:protected] => 875 [trace:Exception:private] => Array
 * 2017-01-17 5:31:54.572552 – ERROR –> get_api(): The access token has expired;
   fetching a refresh token.
    2017-01-17 5:31:54.893064 – ERROR –> refreshToken():
   Refreshing access token failed. Here is the error type: OAuth\Common\Http\Exception\
   TokenResponseException 2017-01-17 5:31:54.893346 – ERROR –> get_api(): The refreshToken
   call has failed. This may be due to your Salesforce Instance “Refresh Token Policy”.
   If it is not set to “Refresh token is valid until revoked” (the default), that
   can cause problems. 2017-01-17 5:31:54.893548 – ERROR –> See [http://www.salesforce.com/us/developer/docs/packagingGuide/Content/connected_app_manage_edit.htm#oauth_policies](http://www.salesforce.com/us/developer/docs/packagingGuide/Content/connected_app_manage_edit.htm#oauth_policies)
   for more information. 2017-01-17 5:31:54.898062 – ERROR –> api_is_valid(): $api
   is string or has an error: 2017-01-17 5:31:54.898317 – ERROR –> export(): Invalid
   API. 2017-01-17 5:32:52.286129 – ERROR –> get_api(): There was an error getting
   the connection to Salesforce. The error message was: INVALID_SESSION_ID: This
   session is not valid for use with the API

The topic ‘Random logouts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gravity-forms-salesforce_fbfdff.svg)
 * [Gravity Forms Salesforce Add-on](https://wordpress.org/plugins/gravity-forms-salesforce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-salesforce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-salesforce/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-salesforce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-salesforce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-salesforce/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [efkwp](https://wordpress.org/support/users/efkwp/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/random-logouts/)
 * Status: not resolved