Resolve the Session Timeout issue in the SharePoint Provider Hosted add-in

I am working on a SharePoint Provider Hosted app for a long time now. I have a good amount of experience in working with the SharePoint’s App Model and especially with the SharePoint Online.

Currently I am working on same type of project which is hosted in azure and deployed in SharePoint Online.

Project module is already deployed to production environment and clients are using them happily.

But today client has come with an issue of they are not able to submit the form.

Problem: Client is not able to submit the form from the Provider hosted app which has the code hosted on azure.(I have used the MVC as the back end to write the code with C#)


  • I have tried to submit the test data and it submitted without error
  • I have tried to submit the data with the same data as client is submitting still it has submitted successfully.
  • So to trouble shoot the issue properly I went a call with the client it submitted successfully during the call too.
  • While I was on a call with a client at that time client stated that it took him almost 1.5 Hours to capture the data to be submitted and during that period form is opened and in ideal state.
  • At that I got a strike in my mind that this is the issue of session timeout for the MVC application

Root Cause:

  • So I started to regenerate the same issue by putting the page ideal for 30 minutes as I know there is a default timeout of 20 minutes and viola I am able to regenerate it.


  • After so much of trial and error finally I am able to resolve this issue by adding a dummy call to an ActionResult which does nothing and simply returns the “Success” as JSON result.
  • Then I wrote up a java script block in a java script file and then reference it to the shared view.
  • A JavaScript block calls that dummy action every 5 minutes to keep the session alive.

If you are using ASP.NET MVC – you do not need an additional HTTP handler and some modifications of the web.config file. All you need – just to add some simple action in a Home/Common controller:

public JsonResult KeepSessionAlive() {
    return new JsonResult {Data = "Success"};

write a piece of JavaScript code like this one (I have put it in one of site’s JavaScript file):

var keepSessionAlive = false;
var keepSessionAliveUrl = null;

function SetupSessionUpdater(actionUrl) {
    keepSessionAliveUrl = actionUrl;
    var container = $("#body");
    container.mousemove(function () { keepSessionAlive = true; });
    container.keydown(function () { keepSessionAlive = true; });

function CheckToKeepSessionAlive() {
    setTimeout("KeepSessionAlive()", 300000);

function KeepSessionAlive() {
    if (keepSessionAlive && keepSessionAliveUrl != null) {
            type: "POST",
            url: keepSessionAliveUrl,
            success: function () { keepSessionAlive = false; }

and initialize this functionality by calling a JavaScript function:


Please note! I have implemented this functionality only for authorized users (there is no reason to keep session state for guests in most cases) and decision to keep session state active is not only based on – is browser open or not, but authorized user must do some activity on the site (move a mouse or type some key).

Courtesy: Maryan

Do let me know if you are able to resolve this or have any other concerns in a comment box below.

Happy Share Pointing!!!

SharePoint 2013 Content Types and Columns

All of the available OOTB content types and their related columns in SharePoint Server 2013 are listed below (let me know if I missed any). I retrieved this information using PowerShell, as I describe in an earlier post. The parent content types were discovered by analyzing the content type IDs (which continues to work as it did in previous versions of SharePoint).

Courtsey: @J. Kevin parker for the excel

nike air jordan team elite 2 toddler kids shoe

nike mercurial superfly vi elite fg x kim jones high top soccer cleats total orange blacknike air bakin retro release informationadidasnbapr 21 2014 60adidas ultra boost 3 0 triple black release date
nike air jordan team elite 2 toddler kids shoe [url=]nike air jordan team elite 2 toddler kids shoe[/url]

WordPress – Easy Google AdSense Plugin

I am a new bee in the world of word press.Actually I am not a new to the wordpress or blogging sites like wordpress or blogger. I have my couple of blogs in blogger few time ago. But then I switched to the WordPress blogs and then ultimately had my own domain on which you are right now 🙂

Basically a main purspose of having a blog is to store information which can be useful to others and yourself and yeah as you will say making some money.

I am not the exception to this and for that I decided to have most successful advertising platform “Google AdSense”.

But as I said I am new bee in the world of wordpress, I am not familiar about how to get that setup in my own domain.

At that time google has come to my rescue and I found one plugin which does this job easily for me without any much hassle.

I know you all are curious to know the name of that plugin, so not making you wait longer I am reveling the name of that plugin.

So the name of that plug in issssss…. “Easy Google AdSense

This is the coolest plugin I have came across to setup my adsense account in my word press site.

You can read their documentation to know How to install it and configure it with your Google Adsense account.

Link for the site :

If you have used this or any other cool thing to achieve this same, do let me know in a comments below.

Happy Publishing!!!!