I have one site collection where I need a data from Session Storage. So I enable my Session from web.config. I know it is not recommended Session in Sharepoint, but my client needs it.

So Basically My need is I have two login option one with SharePoint default login which is working perfectly fine. but in second option I am using form based authentication. its also working fine, but the problem is when I logged for the first time then I Set one Session variable. the basis of that variable I am calling one web service outside of SharePoint which is returning with my username.

when I refresh my page after 4-5 hours session is set to null because of a session timeout. Can we set SharePoint Session timeout same as SharePoint default logout time? if yes please suggest something. I already follow this link, but unfortunately, it is not working for me.

  • Hi, you cannot actually stop a workflow or pause it for some duration in the SharePoint. However, if you try this it will stop the workflow for a while and then you’ll be able to to do it correctly:
    – Noman
    Mar 6, 2020 at 19:18

3 Answers 3


You need to do that in web.config of our application under sessionstorage section:

          <sessionState mode="Off|InProc|StateServer|SQLServer"
          timeout="number of minutes"
          sqlConnectionString="sql connection string"
          stateNetworkTimeout="number of seconds"/>

Maybe this is a solution for you (needs to be changed in your web.config):

<forms name=”name” 
      loginUrl=”url”—————————- This was configured when you configured FBA
      timeout=”30″ ————————— This is the default expiration (set it here at your convenience)
  <credentials passwordFormat=”format”/>



Not really sure if that can help you, but I use this function to refresh active sessions:

    function refreshDigestToken() {
        url: _spPageContextInfo.webAbsoluteUrl + "/_api/contextinfo",
        method: "POST",
        headers: {
            "Accept": "application/json; odata=verbose"
        success: function (data) {
        error: function (data, errorCode, errorMessage) {

That way the token should automatically be used for further actions. I have that function on a timer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.