java - How to redirect to login page after page refresh -
i using jquery mobile application , java @ server side. user has redirected login page, i.e. index.html, if user presses refresh button.
can done using javascript or need add java code achieve it?
with javascript can handle onbeforeunload event. don't know if user refreshes or navigates away. need localstorage or cookies keep state , check if user refreshes can redirect them. don't know if possible in onbeforeunload event, recommend fix server side. need have logic server side.for example keep last page in session , if equals new page redirect index.html.