473,387 Members | 1,882 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,387 software developers and data experts.

How to check if a different user is logged in?

Hiya guys.

While being logged in, i want to check wether a different user is also logged in.
Now this is easy done with databases, which I am familiar with and sessions, but the problem however is:

How can I tell when the user is NOT online?
I can't view someone else's sessions I assume.

Thanks
Mar 10 '11 #1
4 1779
dgreenhouse
250 Expert 100+
You'd need some type of code that flags when the user logs in/logs out.

Since web apps are stateless, and a given user can just turn off their computer without logging out, the first statement above may be of little value without additional tracking logic.
{ Such as tracking activity via time of last activity, but this would of course place additional processing load on the server. }

You could possibly correlate the session information with the raw activity logs for fine grained analysis.
Mar 10 '11 #2
What if the user doesn't "Log out", but simply closes the site/browser.

How can I handle that?
(any form of session timeout and a global 'check if OtherUser has running session' ?)
Mar 10 '11 #3
dgreenhouse
250 Expert 100+
I believe I mentioned those conditions; which are very likely to happen often.

You can only track the session information after the fact.

To get this information "real time", you would need to modify the whole web stack with your own code; which would be a very daunting task indeed.

Just track the the time of last activity. If it's within a couple of seconds, there's a good chance the user is still active on the system.

That's probably the best you can do.

The other possibility is to use Ajax pings to the server to determine if the user is logged in and active.
Mar 10 '11 #4
Sounds like a good idea, tracking the last activity by checking if it's within a couple of seconds.
I can do that with mysql I guess :)
Mar 13 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Gus | last post by:
Hi: I know that it is possible to run an application using System.Diagnostics, for example: System.Diagnostics.Process.Start("iexplore"); This will start internet explorer in name of the...
1
by: moondaddy | last post by:
I need to replace a user control on a page with a different user control. The challenge I'm faced with is that this call is being made from the user control being replaced. Normally I replace...
7
by: kris_scheyer | last post by:
Hi, I have a little .exe file that I want the C# code behind of my web application to execute as a different user. The executable is supposed to take a screenshot of the server's display and...
8
by: Bernard Lebel | last post by:
Hello, I would like to know if there is a way to run a Python file under a different user account than the one logged in. Allow me to explain. There are a bunch of people here, they are "basic...
4
by: Rik Hemsley | last post by:
Hi, Our web application impersonates a domain user when it runs. Usually, the printers visible to the application are the same as those visible to the domain user. At one installation, the...
1
by: ranju | last post by:
I am trying to spawn a process (say an exe file) with different user crendentials than that of the current user. 1) Called LogonUserEx() to logon the user and recieve a handle to the token that...
6
by: saddist | last post by:
Hello, For certain reasons I had to make my own USERS table where I store username, passwd, access_lvl and so on. Now I would like to display certian data from database depending on what...
7
by: agoyal2 | last post by:
Hi Guys, I am a ColdFusion newbie and this might be a stupid question for the experienced folks: I have a coldfusion application which uses session to store the logged on user-id (A database...
1
by: Nate.Baxley | last post by:
I have a site that I want to keep the user logged in after they leave the site if they check the "Remember Me" box. How do I go about doing this? Lengthen the session length? Any help would be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.