Hi all,

In View :

var btnLogout = new sap.ui.commons.button({

text : “Logout”,

press : oController.logout

});

In Controller :

logout : function(){

            window.sessionStorage.setItem(“logonapp”,”N”); // logonapp – key , N – value

            window.open(“index.html”,”_self”); // used to open login page

}

once we pressed logout…it will go to first index page now…if user Click on back arrow button in browser it will go to the previous page (where we put logout button).

so that only we are using this session validation…once user clicked logout buttonit will never go to the previous page without giving user id and password…

In Controller :

onInit: function() {

                   

                          if(window.sessionStorage.getItem(“logonapp”) == “N”) {

                           alert(“User logged out. Please login again…”);

                         window.open(“index.html”,”_self”);

                          }

                         },



once we put this code in init…it wont allow user to go previous page without giving user name password once again…………………………………………

Thanks,

Karthik A

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply