473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Browser is closed.

Hello... I want to record all logins and logouts. The problem occurs
when a user CLOSES the browser without clicking the Logout link. How
will I record the "logout time" using javascript? (I'm using PHP to on
the server side.) PLEASE reply...

Jul 20 '06 #1
3 1782
IveCal wrote:
Hello... I want to record all logins and logouts. The problem occurs
when a user CLOSES the browser without clicking the Logout link.
Or he might surf away to another page.
How will I record the "logout time" using javascript? (I'm using PHP
to on the server side.) PLEASE reply...
I think your best option is a timer on page-level, so that a session
automatically expires if a given time interval of inactivity is
exceeded.

If your application is running in a popup-window, and the only
reasonable action besides clicking a logout-button is closing the
popup, then you could use something like this:

<body onUnload="alert('leaving page...');">

Hope this helps,

--
Bart

Jul 20 '06 #2

Bart Van der Donck wrote:
<body onUnload="alert('leaving page...');">
However, this event also occurs if the user also refreshes the page.

Jul 20 '06 #3
web.dev wrote:
Bart Van der Donck wrote:
<body onUnload="alert('leaving page...');">

However, this event also occurs if the user also refreshes the page.
Yes, ... and if user presses Backspace, right-click previous, resend
form, right-click next, click previous-button, click next-button,
etc. That's why I said "reasonable action"; I think one should only use
it if the app runs in a popup window with right-click disabled, perhaps
disable keys F5, Backspace, CTRL-KEYs, etc.

--
Bart

Jul 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Theo | last post by:
Question for the group The authentication system for the site Im working on seems to function properly and all is good. A session keeps track of everything and a cookie is used to accept or deny...
11
by: David Lozzi | last post by:
Hello All, I am having an issue with thus far one computer on my client's web site. If the user loads the shopping cart and then closes all browser windows, then opens them back up, goes back to...
6
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
7
by: Chris | last post by:
Can anybody tell me how to detect is the user has closed the browser Thank you
8
by: ds_lewis | last post by:
Is there a way to tell when the user closes the browser that doesn't also happen when a page is merely being refreshed? Thanks, Targus
0
by: etnaelk | last post by:
Hi all, I have a real bugger of a problem that I just haven't been able to figure out. I am working on writing my own proxy server in C# using TcpListener, TcpClient, HttpWebRequest/Response and...
3
by: Gouri.Mahajan7 | last post by:
Hello, I am new to asp.net. Can anybody please tell me which event is fired when we close the browser. I want to remove some resources when the browser close button is pressed. Thanks in advance....
12
by: jodleren | last post by:
Hi I did not notice. A system I have made, seems on one server to keep the $_SESSION even when the browser has been closed... How can I avoid that? WBR Sonnich
1
by: soni2926 | last post by:
hi, i'm working on a site, which has a session created after a user logins, each page checks to make sure the session is there onload otherwise redirects to the login page. now the clients are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.