About user exit, click the browser back to return to the original page solution 2, still back to the original

Source: Internet
Author: User

About user exit, click the browser back to return to the original page solution 2, still back to the original

Solution 1: Disable caching. The previous method was used on the computer, but there were still problems with ipad and Android mobile phones.

Solution 2: Disable the browser's back key javascript: window. history. forward (1); the result is the same as solution 1, and the pad has no effect.

Solution 3: Response. write ("<script> window. location. replace ('login. aspx ') </script> "); it can still be used to back up. It seems that it is not as good as 1 or 2. However, you can add an onclick event on the front end, which does not involve form submission, as a result, solution 4

Solution 4: Use ajax to clear the session on the ajax page, and add js on the current page

function logout(isLogout) {            if (isLogout != "") {                $.ajax({                    url: "ajax/logout.aspx",                    data: "code=" + encodeURI(isLogout), cache: false,                    datatype: "html",                    success: function (context) {                        LogoutReturn(context);                    }                });            }            else {                return "Error";            }        }        function LogoutReturn(context) {            if (context == "success") {                location.replace('login.aspx');            }        }

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.