Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
karthikarjun
Active Contributor

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 button...it 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

Labels in this area