I am using jQuery's AJAX call to update the data. I have been logged into Firefox on two separate tabs.
I logged out from a tab, the second tab has not yet been refreshed.
When I try to update the data via AJAX, the call executed properly is called.
How do I execute that the user logs out and displays an error while executing the AJAX call?
Before processing the AJAX call on the server side, you must have a check that the user is logged in.
If no session is found, return a special error in the AJAX call; For example: JSON:
{"status": "error", "error": "logout"}
If the application receives this information , The user has a "session expired" message for the display and they are redirected to the login (or other appropriate) page.
Comments
Post a Comment