Thursday, 16 April 2015

Idle Session Timeout in SharePoint 2010 Apply on Master Page

Idle Session Timeout is implemented


 Idle session timeout of the application should be set to maximum half an hour i.e. if the application is not in use for continuous half hour then the session must gets expire automatically.



     <script type="text/javascript">
    var idleTime = 0;
    $(document).ready(function () {
     
        var idleInterval = setInterval(timerIncrement, 60000);  
        $(this).mousemove(function (e) {
            idleTime = 0;
        });
        $(this).keypress(function (e) {
            idleTime = 0;
        });
    });

    function timerIncrement() {
        idleTime = idleTime + 1;
        if (idleTime > 19) {        
  //  var path = "http://ibggn5456-2:3333/_layouts/EY.ComplianceMgr.Login/LoginPage.aspx";
// window.navigate(path);  

var newURL = window.location.protocol + "//" + window.location.host + "/" + "_layouts/EY.ComplianceMgr.Login/LoginPage.aspx";
// alert(newURL); window.navigate(newURL);


// document.location.href = "_layouts/EY.ComplianceMgr.Login/LoginPage.aspx";
        }
    }
</script>


//  Get current page url using JavaScript
var currentPageUrl = "";
if (typeof this.href === "undefined") {
    currentPageUrl = document.location.toString().toLowerCase();
}
else {
    currentPageUrl = this.href.toString().toLowerCase();
}


  • window.location.protocol = "http:"
  • window.location.host = "css-tricks.com"
  • window.location.pathname = "example/index.html"
  • var newURL = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname;

No comments:

Post a Comment