I need to alert an user about session time out for browser enabled InfoPath forms. Its not about changing/configuring the session time out but to just show an alert to user that his/her form is gonna get time out. If alert is not possible in any way, could you tell me any workaround?


  • What version of sharepoint?
    – Aaron
    Commented May 18, 2016 at 13:06

1 Answer 1


What version of Sharepoint are you running?

You could create a page with the infopath form as a web part on the page, and add a javascript timeout in a script webpart to put up an alert window. the code would look like:

function showAlert(){
alert('Your Session is about to expire, Save Now');
setTimeout(showAlert, 1000*60*60*20 );//20 hrs

You mentioned in a comment detecting if the user is active or not. I wouldn't take that effort, I believe that the infopath form timeout value is independent of the user's active status. I would that the form's timeout value, and set a page alert for just shy of that value, telling the user to save.

Central Admin

Here in my form the timeout is 1 day, so say after 20 hours I might popup an alert window.

  • Thanks Aaron for turning up so fast, I've posted the code i've been using as the answer, Could you please look into that?
    – Vish
    Commented May 17, 2016 at 19:06
  • @Abilash posted the code where?
    – Aaron
    Commented May 17, 2016 at 19:57
  • Here is the link css-tricks.com/snippets/jquery/fire-event-when-user-is-idle I've exactly copied the same code
    – Vish
    Commented May 17, 2016 at 20:38
  • @Abilash I wouldn't worry about when the user is moving the mouse or things like that, the session timeout value is independent of that, as for as I am aware. I am going to update my answer with for information as to what I recommend.
    – Aaron
    Commented May 17, 2016 at 20:48
  • its not working for me, what i've did is Opened the infopath form in Infopathform webpart, used a content editor and used the code <script> setTimeout(alert('Your Session is about to expire, Save Now', 1000*60);//20 hrs </script> But no alert shows up even if the page stays idle for more than a minute.
    – Vish
    Commented May 17, 2016 at 21:28

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.