Posted on 2004-11-13
Last Modified: 2013-12-24

i have a login page for students .After the students login, their details such as UId,FNAMe,LNAME  and login time are entered into the database .After logging out their logout time is updated in the database(Enterprise Manager).
But some students logout after viewing their page by closing the browser window instead of clicking on the logout button.So their logout time is not shown in the database and it shows NULL.
What shud be done to capture the logout time of the students even when they close their window?

Question by:jaiswalpragya
    LVL 33

    Expert Comment

    you cannot accurately capture window close event
    LVL 33

    Expert Comment

    LVL 33

    Accepted Solution

    May wish to read these

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <SCRIPT LANGUAGE="JavaScript">
    function RorC() {

    var top=self.screenTop;
    if (top>9000)
    {alert('window was closed')}
    {alert('window was Refreshed')}


    <BODY BGCOLOR="#FFFFFF" onunload="javascript:if (document.all){RorC()} else {var top=window.outerWidth;if (top==0) {opener.alert('window was closed')} else {opener.alert('window was Refreshed')}}">
    Your Body Here
    LVL 17

    Assisted Solution

    I would do a check upon next login to see if they logged out last time, if not, I would display a nice big message explaining to them why they should log out (Security and all that) and give them a friendly reminder...

    Thats about the best you can do.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now