Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

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 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

Related Hot Questions

Government Jobs Opening