473,699 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Log when users sign in/end session

In my asp.net app I'm logging whenever someone signs in through the login
page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks
Nov 18 '05 #1
4 1582
Hey there,

I forget the code, its late so pardon my vagueness, but there is Javascript
code that will let you popup another popup window on browser close, you
could probably get away with doing something like that, then in the page you
popup, run your code that says "Hey, im quitting my session"

hth,

Todd

"VB Programmer" <Do************ *****@jEmail.co m> wrote in message
news:uK******** ******@TK2MSFTN GP15.phx.gbl...
In my asp.net app I'm logging whenever someone signs in through the login
page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks

Nov 18 '05 #2
You can attempt to do this either through a dedicated signout page, or you
can try to do it through the Session's OnEnd event. Be aware though, the
OnEnd event is primarily for garbage collection and doesn't handle the
creation of certain objects. You can't do anything when a user closes a
browser, because you never know when they close a browser since the user is
disconnected the millisecond they stop receiving the requested web page and
files.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"VB Programmer" <Do************ *****@jEmail.co m> wrote in message
news:uK******** ******@TK2MSFTN GP15.phx.gbl...
In my asp.net app I'm logging whenever someone signs in through the login
page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks

Nov 18 '05 #3
Thanks guys. I ended up using Session_End in Global.asax.

Take care...

"Mark Fitzpatrick" <ma******@fitzm e.com> wrote in message
news:eO******** ******@TK2MSFTN GP10.phx.gbl...
You can attempt to do this either through a dedicated signout page, or you
can try to do it through the Session's OnEnd event. Be aware though, the
OnEnd event is primarily for garbage collection and doesn't handle the
creation of certain objects. You can't do anything when a user closes a
browser, because you never know when they close a browser since the user is disconnected the millisecond they stop receiving the requested web page and files.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"VB Programmer" <Do************ *****@jEmail.co m> wrote in message
news:uK******** ******@TK2MSFTN GP15.phx.gbl...
In my asp.net app I'm logging whenever someone signs in through the login page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks


Nov 18 '05 #4
That's what I'd do: use Session_End. But, know that it doesn't fire when
they close the browser...only after the app eventually gives up on the
session (20 minutes by default), or you call session.abandon , etc. It also is
only good if SessionStateMod e is "inproc" (the default). Finally, there's a
response.isclie ntconnected property out there. Never used it...not sure if it
more accurately determines that a session has ended (I don't think so).
Anyway, Session_End is as good as any I know of.

Bill

"VB Programmer" wrote:
Thanks guys. I ended up using Session_End in Global.asax.

Take care...

"Mark Fitzpatrick" <ma******@fitzm e.com> wrote in message
news:eO******** ******@TK2MSFTN GP10.phx.gbl...
You can attempt to do this either through a dedicated signout page, or you
can try to do it through the Session's OnEnd event. Be aware though, the
OnEnd event is primarily for garbage collection and doesn't handle the
creation of certain objects. You can't do anything when a user closes a
browser, because you never know when they close a browser since the user

is
disconnected the millisecond they stop receiving the requested web page

and
files.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"VB Programmer" <Do************ *****@jEmail.co m> wrote in message
news:uK******** ******@TK2MSFTN GP15.phx.gbl...
In my asp.net app I'm logging whenever someone signs in through the login page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks



Nov 18 '05 #5

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

Similar topics

12
2514
by: Dave Smithz | last post by:
Hi there, Users of my PHP DB application have complained that it seems to log them out every now and then. I actually assume this is when it has been idle for sometime as I use session variables to store a logged in token. With only basic knowledge of sessions I assumed there was some kind of default time before the session data is destroyed. Is this the case?
2
4078
by: Christopher Johannsen | last post by:
Good Day: I am working on building a tool Using ASP/COM & IIS5.1 for a non-administrative technical support team to change domain passwords for users. I have the basic interface built and working from my developement machine (Windows XP Pro SP 1A) which is hosting the pages for now. The problem is that when I try to access the site from a browser on a different pc using my credentials (IIS is running in Windows Authentication), it...
0
1537
by: Betty Harvey | last post by:
The next meeting of the XML Users Group will be held on Wednesday, February 18, 2004 at the American Geophysical Union (AGU) at 2000 Florida Avenue, N.W., Washington, DC 20009-1277. The meeting starts at 7:00 p.m. and usually last approximately 2 hours. If attending the meeting by Metro, get off the Dupont Circle stop and walk north to Florida Avenue...turn right. Michael Hahn will be chairing the February meeting. There is no cost...
7
1851
by: Simon Harvey | last post by:
Hi everyone, I'm having a frustrating problem and I don't know how to fix it without totally redoing a very complicated couple of pages on my site. I really hope some kind soul can help me :-) Its a very simple situation: I have 1 page that serves to create and update users and another page to add roles to the user.
4
10118
by: Keith-Earl | last post by:
I thought for sure Session End would fire when the user closes his browser, but no luck. The only way I can get the event to fire is to run a Session.Abandon, but is that really practicle? When a user is down they will probably close out the browser or navigate somewhere else. I want to keep a total count of users in an Application state variable but I cannot count on the decrement code to run. What can I do to keep up with Total Users...
31
4968
by: Manfred Kooistra | last post by:
If I have a document like this: <html> <head> <script language=javascript> window.location.href='file.php'; </script> </head> <body> body content
12
1806
by: dino d. | last post by:
hi everyone- my subject pretty much says it all- is there a secure way to do this? the non-secure ways are, as i understand it, to populate a listbox with indices as names, or maybe use a hidden control. is the only secure way with sessions? i was also thinking about perhaps creating a meta table that says who is editing which record right now. any advice? thanks, dino
0
1463
by: Justin Dutoit | last post by:
Hey! I'm sorry if this is a bit of a newbie question, but I am gettting unwanted 'Runtime error' messages, i.e. not the error proper, and customErrors mode="Off" doesnt' seem to work. My web.config file probably needs something- it is below. Please help soon... <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <!-- DYNAMIC DEBUG COMPILATION Set compilation debug="true" to insert debugging symbols (.pdb
3
1681
by: sravani2 | last post by:
Hi, I created the sign in page with username,password fields.and along with those fields i put the check box remember and select that one untill we sign out the page the username and password are remains.For that sign page i wrote the code like this <?php // The database connection. $con = mysql_connect($db_host, $db_user, $db_pass); if(!$con) { die("Cannot connect. " . mysql_error()); } $dbselect = mysql_select_db($db_name);...
0
8618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8916
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7752
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2348
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.