I created a clientside application for SharePoint using javascript and jquery. We use Rest API for CURD operation on SharePoint Data and config Idle Session Timeout for the inactive user. After a user session expired all rest request, return Access denied Error:

Access denied. You do not have permission to perform this action or access this resource.

How to determine user logged in and session not expired (before sending rest request and reloading page) only using javascript and jquery? Is FedAuth cookie useful for this problem and how?

  • What about keeping the session active by sending a request in the background every minute or so? When the server returns an error, you could also get a new request digest and start using the new one maybe?
    – AymKdn
    Apr 28, 2021 at 6:58
  • @AymKdn , it is possible but i don't want keep session active for idle session, any solution??
    – m0st4f4
    Apr 28, 2021 at 8:26
  • You can do a POST to "/_api/contextinfo" to get a new digest that you can then insert into the hidden "__REQUESTDIGEST" in the page. I don't know if it will work in your case? I only tested it with Sharepoint 2013
    – AymKdn
    Apr 28, 2021 at 12:19


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.