Organizational Research By

Surprising Reserch Topic

Question:Handling autologout functionality for ajax request as well as normal url request from browser


i m trying this:

Storing time limit for autologout in a session variable inactivityTime. Keeping this value lower than session.gcmaxlifetime since session values will not be accessible after time specified by gcmaxlifetime.
    Comparing inactivity time on every page request and perform the logout action as required, which includes destroying session and redirecting to login page.
    For each page request I am also checking if the request is made through ajax request or from the browser directly. I am doing this by comparing the $_SERVER['HTTP_X_REQUESTED_WITH'] E.g. : if www.example.com/ajax/test.php is requested through ajax then output of the script is loggedOut and redirection is taken care in javascript, and incase someone tries to access this url throgh browser then that user will be directly redirected to login page.
asked Sep 13, 2013 in Java Interview Questions by anonymous
edited Sep 12, 2013
0 votes
108 views



Related Hot Questions



Government Jobs Opening


...