1

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.

1
  • 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

0

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

          <sessionState mode="Off|InProc|StateServer|SQLServer"
          cookieless="true|false"
          timeout="number of minutes"
          stateConnectionString="tcpip=server:port"
          sqlConnectionString="sql connection string"
          stateNetworkTimeout="number of seconds"/>
0

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
      protection=”All|None|Encryption|Validation”
      timeout=”30″ ————————— This is the default expiration (set it here at your convenience)
      path=”/” 
      requireSSL=”true|false”
      slidingExpiration=”true|false”>
  <credentials passwordFormat=”format”/>
</forms>

https://blogs.technet.microsoft.com/victorbutuza/2008/08/26/forms-based-authentication-timeout/

0

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

    function refreshDigestToken() {
    $.ajax({
        url: _spPageContextInfo.webAbsoluteUrl + "/_api/contextinfo",
        method: "POST",
        headers: {
            "Accept": "application/json; odata=verbose"
        },
        success: function (data) {
            $('#__REQUESTDIGEST').val(data.d.GetContextWebInformation.FormDigestValue);
        },
        error: function (data, errorCode, errorMessage) {
            console.log(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 that you have read and understand our privacy policy and code of conduct.

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