Technical reprinting (when you click the X Window to close IE and clear the session, the most basic thing is to use it to process repeated user login. I think the key to this is how to capture the close ie action, then use the session as needed. invalidat

Source: Internet
Author: User
I think this requirement is necessary for both large and small projects. I have asked many people online, and I have also encountered such a requirement. I have consulted a lot of such materials. Then, I will summarize it through practice. Rat
Click the X Window to close IE and clear the session. The most basic thing is to use it to process repeated user login. I think the key to this is how to capture the close ie action, and then follow its own
You must use session. invalidate () or session. removeattribute ("XXX. Next we will focus on how to capture this action: first, the current system page structure is generally divided into two types, Framework and non-framework. Framework: <Script language =" Javascript "> Function removeline () {If (event. clientx <0 & event. clienty <0) {alert (" I entered the removeline method, which indicates that the capture is effective! "); Document. Write ('<IFRAME
Width = "100" Height = "100" src = "XXX. jsp"> </iframe> <object
Classid = CLSID: 8856f961-340a-11d0-a96b-00c04fd705a2
Height = 0 id = webbrowser width = 0> </Object> '); Document. All. webbrowser. execwb (45, 1 ); }}</SCRIPT> then you only need to call this method in frameset. <Frameset ............. OnUnload = "removeline ();"> </Frameset>
NOTE: If (event. clientx <0 & event. clienty <0) is not disabled for Alt + F4.
Ie. If you want to add the image, change it to If (event. clientx <0 & event. clienty <0 &
&) | Event. altkey) xxx. jsp in the removeline method is the page for you to write details about the session. Non-framework:     For Non-framework processing and framework processing are different. The implementation method is as follows: <script language = "JavaScript"> Function window. onUnload (){ If (window. screenleft> = 10000 & window. screentop> = 10000) | event. altkey) { Alert (" Identify closing ie !!! "); } } </SCRIPT> By the way: In the end, I would like to say that we recommend that the system use the Page Structure of the framework. There are many advantages in this way, and there are also many advantages for a single permission. First
First, why should we clear the session? Clearing the session must be based on what the session controls and makes some judgment. We call Clearing the session when closing IE.
Session refers to clearing the session on the server. As we all know, the session on the client is automatically destroyed when you close IE. Therefore
If a non-framework structure is used, some problems will occur. In a simple example, you open three pages of the system, and X drops one of the pages, this naturally triggers the party who clears the session.
So the session corresponding to the server should be cleared, and what should you do if the page is still open .......... The advantage of the framework structure is to always run only one page to avoid the above problems. Of course, there are many advantages for using the framework. I will not go into details here. The level below is limited. If you have any problems, please kindly advise!

 

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.