javascript - How to implement the principle of timeout and exit without operation after logging in to the website for a period of time, how to deal with it on the front end and the back end respectively?
欧阳克
欧阳克 2017-06-28 09:23:39
0
2
1272

How can I log out after logging in to the website for a period of time, for example, if there is no operation for 30 minutes?
What processing is required on the backend and frontend?

欧阳克
欧阳克

温故而知新,可以为师矣。 博客:www.ouyangke.com

reply all(2)
仅有的幸福

Front-end sends request

The backend gets the request, clears the session, and then redirects directly,

Or return the front-end response and let the front-end redirect


The meaning of the question is ambiguous

If the session takes effect during the operation and causes timeout redirection

You can put some tags in the response header, delete them if they are expired, or change them

In this way, when everything involves requests, you can find the effectiveness of the session and redirect the front end

ringa_lee

For the front end, if the login times out, there will be a return value after the timeout. You can operate based on the return value, log out of the login page, close the web page, etc.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!